The use of 'user' as a column name no longer causes errors in SquirrelMail/PostgreSQL
[squirrelmail.git] / plugins / listcommands / options.php
CommitLineData
b5f6b945 1<?php
2
3/**
4 * SquirrelMail List Commands Plugin
5 * options.php
6 *
7 * Shows options page for managing non-RFC-compliant list subscriptions.
8 *
1977ab55 9 * @copyright 1999-2010 The SquirrelMail Project Team
b5f6b945 10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @version $Id$
12 * @package plugins
13 * @subpackage listcommands
14 */
15
16
17include_once('../../include/init.php');
18include_once(SM_PATH . 'plugins/listcommands/functions.php');
19
20global $listcommands_allow_non_rfc_list_management, $data_dir, $username;
21
22// only allow management of non-RFC lists if admin deems necessary
23//
24@include_once(SM_PATH . 'plugins/listcommands/config.php');
25if (!$listcommands_allow_non_rfc_list_management)
26 return;
27
28
29$lists = get_non_rfc_lists();
30
31
32
33// remove list?
34//
35if (sqGetGlobalVar('deletelist', $deletelist, SQ_FORM)
36 && is_array($deletelist) && !empty($deletelist)) {
37
38 // interface currently does not support multiple deletions at once
39 // but we'll support it here anyway -- the index values of this
40 // array are the only thing we care about and need to be the
41 // index number of the list to be deleted
42 //
43 foreach (array_keys($deletelist) as $index)
44 unset($lists[$index]);
45
46 sort($lists);
47 $temp_lists = array();
48 foreach ($lists as $index => $list_addr)
49 $temp_lists[] = $index . '_' . $list_addr;
50 setPref($data_dir, $username, 'non_rfc_lists', implode(':', $temp_lists));
51
52}
53
54
55
56// add list?
57//
58if (sqGetGlobalVar('addlist', $ignore, SQ_FORM)
59 && sqGetGlobalVar('newlist', $newlist, SQ_FORM)) {
60
61 $lists[] = $newlist;
62
63 sort($lists);
64 $temp_lists = array();
65 foreach ($lists as $index => $list_addr)
66 $temp_lists[] = $index . '_' . $list_addr;
67 setPref($data_dir, $username, 'non_rfc_lists', implode(':', $temp_lists));
68
69}
70
71
72
876fdb60 73displayPageHeader($color);
b5f6b945 74
75$oTemplate->assign('lists', $lists);
76$oTemplate->display('plugins/listcommands/non_rfc_lists.tpl');
cdb3b004 77$oTemplate->display('footer.tpl');
b5f6b945 78
79