include_general.php 2.25 KB
Newer Older
1
<?php
2
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
3
//
4 5
// 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
6
// $Id$
7

8 9
// This script may only be included - so its better to die if called directly.

changi67's avatar
changi67 committed
10
require_once ('tiki-setup.php');
11
$access->check_script($_SERVER['SCRIPT_NAME'], basename(__FILE__));
12

13
if (isset($_REQUEST['new_prefs'])) {
14 15 16
	$listgroups = $userlib->get_groups(0, -1, 'groupName_asc', '', '', 'n');
	$in = array();
	$out = array();
17
	foreach ($listgroups['data'] as $gr) {
18
		if ($gr['groupName'] == 'Anonymous') {
19
			continue;
20
		}
21

22 23
		if ($gr['registrationChoice'] == 'y'
				&& isset($_REQUEST['registration_choices'])
24
				&& !in_array($gr['groupName'], $_REQUEST['registration_choices'])
25 26
		) {
			// deselect
27
			$out[] = $gr['groupName'];
28 29
		} elseif ($gr['registrationChoice'] != 'y'
						&& isset($_REQUEST['registration_choices'])
30 31 32 33
						&& in_array($gr['groupName'], $_REQUEST['registration_choices'])
		) { //select
			$in[] = $gr['groupName'];
		}
34 35 36
	}
	check_ticket('admin-inc-general');
	$pref_toggles = array(
37
		'feature_wiki_1like_redirection',
38
	);
39
	foreach ($pref_toggles as $toggle) {
40 41 42
		simple_set_toggle($toggle);
	}
	$pref_byref_values = array(
43
		'server_timezone',
44
	);
45
	foreach ($pref_byref_values as $britem) {
46 47
		byref_set_value($britem);
	}
48
	$tikilib->set_preference('display_timezone', $tikilib->get_preference('server_timezone'));
49
	// Special handling for tied fields: tikiIndex, urlIndex and useUrlIndex
50
}
51

52
$smarty->assign('now', $tikilib->now);
53

54
if (!empty($_REQUEST['testMail'])) {
55 56
	include_once('lib/webmail/tikimaillib.php');
	$mail = new TikiMail();
57
	$mail->setSubject(tra('Tiki Email Test'));
58
	$mail->setText(tra('Tiki Test email from:') . ' ' . $_SERVER['SERVER_NAME']);
59
	if (!$mail->send(array($_REQUEST['testMail']))) {
60
		$msg = tra('Unable to send mail');
61 62 63 64 65
		if ($tiki_p_admin == 'y') {
			$mailerrors = print_r($mail->errors, true);
			$msg .= $mailerrors;
		}
		$smarty->assign('error_msg', $msg);
66
	} else {
67
		 add_feedback('testMail', tra('Test mail sent to') . ' ' . $_REQUEST['testMail'], 3);
68
	}
69
}
70 71 72
$engine_type = getCurrentEngine();
$smarty->assign('db_engine_type', $engine_type);

73
ask_ticket('admin-inc-general');