tiki-switch_theme.php 914 Bytes
Newer Older
changi67's avatar
changi67 committed
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
// $Id$
awcolley's avatar
awcolley committed
10

changi67's avatar
changi67 committed
11
require_once ('tiki-setup.php');
chealer's avatar
chealer committed
12 13

$access->check_feature('change_theme');
14
if (!empty($group_theme)) {
15 16
	$access->display_error(NULL, 'A group theme is defined.');
}
chealer's avatar
chealer committed
17

18
if (isset($_REQUEST['theme'])) {
19

20 21
	if (empty($_REQUEST['theme'])) {
		$_REQUEST['theme_option'] = '';
22
	}
23
	
24 25 26
	$tikilib->set_user_preference($user, 'theme', $_REQUEST['theme']); //save user's theme preference
	$tikilib->set_user_preference($user, 'theme_option', $_REQUEST['theme_option']);

27 28 29 30 31 32
}

if (isset($_SERVER['HTTP_REFERER'])) {
	$orig_url = $_SERVER['HTTP_REFERER'];
} else {
	$orig_url = $prefs['tikiIndex'];
33
}
awcolley's avatar
awcolley committed
34 35
header("location: $orig_url");
exit;