tiki-userversions.php 1.33 KB
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
6
// 
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
changi67's avatar
changi67 committed
9 10
// $Id$

11
require_once ('tiki-setup.php');
12
$histlib = TikiLib::lib('hist');
13 14 15 16

$access->check_feature('feature_wiki');
$access->check_permission('tiki_p_admin');

17
// We have to get the variable ruser as the user to check
18 19
if (!isset($_REQUEST["ruser"])) {
	$smarty->assign('msg', tra("No user indicated"));
20
	$smarty->display("error.tpl");
21
	die;
22
}
23
if (!user_exists($_REQUEST["ruser"])) {
mose's avatar
mose committed
24
	$smarty->assign('msg', tra("Non-existent user"));
25
	$smarty->display("error.tpl");
26
	die;
27
}
28 29 30 31 32 33 34 35 36
$smarty->assign_by_ref('ruser', $_REQUEST["ruser"]);
$smarty->assign('preview', false);
if (isset($_REQUEST["preview"])) {
	$version = $histlib->get_version($_REQUEST["page"], $_REQUEST["version"]);
	$version["data"] = $tikilib->parse_data($version["data"]);
	if ($version) {
		$smarty->assign_by_ref('preview', $version);
		$smarty->assign_by_ref('version', $_REQUEST["version"]);
	}
37
}
38
$history = $histlib->get_user_versions($_REQUEST["ruser"]);
39
$smarty->assign_by_ref('history', $history);
40
ask_ticket('userversion');
41
$smarty->assign('mid', 'tiki-userversions.tpl');
42
$smarty->display("tiki.tpl");