tiki-admin_mailin.php 1.56 KB
Newer Older
lrargerich's avatar
lrargerich 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
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.
9
// $Id$
changi67's avatar
changi67 committed
10

11
require_once ('tiki-setup.php');
12
//check if feature is on
13
$access->check_feature('feature_mailin');
14
$access->check_permission(array('tiki_p_admin_mailin'));
15

16 17
$mailinlib = TikiLib::lib('mailin');

changi67's avatar
changi67 committed
18
// List
19
$accounts = $mailinlib->list_mailin_accounts(0, -1, 'account_asc', '');
20 21 22
$smarty->assign('accounts', $accounts['data']);

if (isset($_REQUEST['mailin_autocheck'])) {
23 24 25 26
	if ($_REQUEST['mailin_autocheck'] == 'y' && !(preg_match('/[0-9]+/', $_REQUEST['mailin_autocheckFreq'])
			&& $_REQUEST['mailin_autocheckFreq'] > 0))
	{
		Feedback::warning(tra('Frequency should be a positive integer!'));
27
	} else {
28 29
		$tikilib->set_preference('mailin_autocheck', $_REQUEST['mailin_autocheck']);
		$tikilib->set_preference('mailin_autocheckFreq', $_REQUEST['mailin_autocheckFreq']);
30
		if ($prefs['mailin_autocheck'] == 'y') {
31 32
			Feedback::warning(sprintf(tra('Mail-in accounts set to be checked every %s minutes'),
				$prefs['mailin_autocheckFreq']));
33
		} else {
34
			Feedback::warning(sprintf(tra('Automatic Mail-in accounts checking disabled')));
35 36
		}
	}
37
}
38

39
$artlib = TikiLib::lib('art');
40

41
$smarty->assign('mailin_types', $mailinlib->list_available_types());
42
ask_ticket('admin-mailin');
43

44 45
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
46
$smarty->display('tiki-admin_mailin.tpl');