/**
* Message and Spam Filter Plugin
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This plugin filters your inbox into different folders based upon given
* Also view plugins/README.plugins for more information.
*
* $Id$
+ * @package plugins
+ * @subpackage filters
*/
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
define('SM_PATH','../../');
/* SquirrelMail required files. */
require_once(SM_PATH . 'plugins/filters/filters.php');
global $AllowSpamFilters;
-$username = $_SESSION['username'];
-$key = $_COOKIE['key'];
-$onetimepad = $_SESSION['onetimepad'];
-$delimiter = $_SESSION['delimiter'];
+/* get globals */
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
-if (isset($_GET['action'])) {
- $action = $_GET['action'];
-}
+sqgetGlobalVar('action', $action, SQ_GET);
+/* end globals */
displayPageHeader($color, 'None');
html_tag( 'td', '', 'left' ) .
'<select name="filters_spam_folder_set">';
- for ($i = 0; $i < $numboxes; $i++) {
- if (! in_array('noselect', $boxes[$i]['flags'])) {
- $box = $boxes[$i]['unformatted'];
- $box2 = str_replace(' ', ' ', $boxes[$i]['formatted']);
- if ($filters_spam_folder == $box) {
- echo "<OPTION VALUE=\"$box\" SELECTED>$box2</OPTION>\n";
- } else {
- echo "<OPTION VALUE=\"$box\">$box2</OPTION>\n";
- }
- }
- }
+ $selected = 0;
+ if ( isset($filters_spam_folder) )
+ $selected = array(strtolower($filters_spam_folder));
+ echo sqimap_mailbox_option_list(0, $selected, 0, $boxes);
echo '</select>'.
'</td>'.
'</tr>'.