forked from tikiorg/tiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tiki-admin_mailin.php
52 lines (45 loc) · 1.73 KB
/
tiki-admin_mailin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* @package tikiwiki
*/
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// 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.
// $Id$
require_once ('tiki-setup.php');
//check if feature is on
$access->check_feature('feature_mailin');
$access->check_permission(array('tiki_p_admin_mailin'));
$mailinlib = TikiLib::lib('mailin');
// List
$accounts = $mailinlib->list_mailin_accounts(0, -1, 'account_asc', '');
$smarty->assign('accounts', $accounts['data']);
if (isset($_REQUEST['mailin_autocheck'])) {
if ($_REQUEST['mailin_autocheck'] == 'y' && !(preg_match('/[0-9]+/', $_REQUEST['mailin_autocheckFreq']) && $_REQUEST['mailin_autocheckFreq'] > 0)) {
$smarty->assign('msg', tra('Frequency should be a positive integer!'));
$smarty->display('error.tpl');
die;
} else {
$tikilib->set_preference('mailin_autocheck', $_REQUEST['mailin_autocheck']);
$tikilib->set_preference('mailin_autocheckFreq', $_REQUEST['mailin_autocheckFreq']);
if ($prefs['mailin_autocheck'] == 'y') {
$tikifeedback[] = array(
'num' => 1,
'mes' => sprintf(tra('Mail-in accounts set to be checked every %s minutes'), $prefs['mailin_autocheckFreq'])
);
} else {
$tikifeedback[] = array(
'num' => 1,
'mes' => sprintf(tra('Automatic Mail-in accounts checking disabled'))
);
}
}
}
$artlib = TikiLib::lib('art');
$smarty->assign('tikifeedback', $tikifeedback);
$smarty->assign('mailin_types', $mailinlib->list_available_types());
ask_ticket('admin-mailin');
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$smarty->display('tiki-admin_mailin.tpl');