From: bbice Date: Fri, 30 Nov 2001 09:10:39 +0000 (+0000) Subject: Split up Message and SPAM filters options pages X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=eec8160076a4381b54b3c1ee0266d436721319f8 Split up Message and SPAM filters options pages git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1816 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/plugins/filters/options.php b/plugins/filters/options.php index 421975b3..540e3c7d 100644 --- a/plugins/filters/options.php +++ b/plugins/filters/options.php @@ -44,15 +44,6 @@ $filters[$theid]["where"] = $filter_where; $filters[$theid]["what"] = $filter_what; $filters[$theid]["folder"] = $filter_folder; - } elseif (isset($spam_submit) && $AllowSpamFilters) { - $spam_filters = load_spam_filters(); - setPref($data_dir, $username, 'filters_spam_folder', $filters_spam_folder_set); - setPref($data_dir, $username, 'filters_spam_scan', $filters_spam_scan_set); - foreach ($spam_filters as $Key => $Value) { - $input = $spam_filters[$Key]['prefname'] . '_set'; - setPref($data_dir, $username, $spam_filters[$Key]['prefname'], - $$input); - } } elseif (isset($action) && $action == 'delete') { remove_filter($theid); } elseif (isset($action) && $action == 'move_up') { @@ -61,10 +52,6 @@ filter_swap($theid, $theid + 1); } - if ($AllowSpamFilters) { - $filters_spam_folder = getPref($data_dir, $username, 'filters_spam_folder'); - $filters_spam_scan = getPref($data_dir, $username, 'filters_spam_scan'); - } $filters = load_filters(); if (isset($action) && ($action == 'add' || $action == 'edit')) { @@ -143,89 +130,6 @@ ''. ''; - } else if (isset($action) && $action == 'spam' && $AllowSpamFilters) { - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); - $boxes = sqimap_mailbox_list($imapConnection); - sqimap_logout($imapConnection); - for ($i = 0; $i < count($boxes) && $filters_spam_folder == ''; $i++) { - if ($boxes[$i]['flags'][0] != 'noselect' && - $boxes[$i]['flags'][1] != 'noselect' && - $boxes[$i]['flags'][2] != 'noselect') { - $filters_spam_folder = $boxes[$i]['unformatted']; - } - } - - echo '
'. - '
'. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''; - - $spam_filters = load_spam_filters(); - - foreach ($spam_filters as $Key => $Value) { - echo "\n" . - '\n"; - } - echo ''. - '
' . _("Move spam to:") . ''. - '
' . - _("Moving spam directly to the trash may not be a good idea at first, since messages from friends and mailing lists might accidentally be marked as spam. Whatever folder you set this to, make sure that it gets cleaned out periodically, so that you don't have an excessively large mailbox hanging around.") . - '
' . _("What to Scan:") . ''. - '
'. - _("The more messages you scan, the longer it takes. I would suggest that you scan only new messages. If you make a change to your filters, I would set it to scan all messages, then go view my INBOX, then come back and set it to scan only new messages. That way, your new spam filters will be applied and you'll scan even the spam you read with the new filters."). - '
$Key - '; - if ($spam_filters[$Key]['link']) { - echo ''; - } - echo $spam_filters[$Key]['name']; - if ($spam_filters[$Key]['link']) { - echo ''; - } - echo '
' . - $spam_filters[$Key]['comment'] . - "
'. - '
'. - '
'; - - sqimap_logout($imapConnection); } echo '
' . @@ -266,48 +170,4 @@ ' '. ''; - - if ($AllowSpamFilters) { - - echo "". - ''. - '
' . _("Spam Filtering") . '
'; - if (! isset($action) || $action != 'spam') { - - echo '

[' . _("Edit") . ']
'; - printf( _("Spam is sent to %s"), ($filters_spam_folder?$filters_spam_folder:_("[not set yet]") ) ); - echo '
'; - printf( _("Spam scan is limited to %s"), (($filters_spam_scan == 'new')?_("New Messages Only"):_("All Messages") ) ); - echo '

'. - ""; - - $spam_filters = load_spam_filters(); - - foreach ($spam_filters as $Key => $Value) { - echo '\n"; - } - echo '
'; - - if ($spam_filters[$Key]['enabled']) { - echo _("ON"); - } else { - echo _("OFF"); - } - - echo ' - '; - - if ($spam_filters[$Key]['link']) { - echo ''; - } - - echo $spam_filters[$Key]['name']; - if ($spam_filters[$Key]['link']) { - echo ''; - } - echo "
'; - } - } - ?> diff --git a/plugins/filters/setup.php b/plugins/filters/setup.php index 5169dba9..aee73927 100644 --- a/plugins/filters/setup.php +++ b/plugins/filters/setup.php @@ -73,6 +73,7 @@ function squirrelmail_plugin_optpage_register_block() { global $optpage_blocks; + global $AllowSpamFilters; $optpage_blocks[] = array( 'name' => _("Message Filters"), @@ -80,5 +81,14 @@ 'desc' => _("Filtering enables messages with different criteria to be automatically filtered into different folders for easier organization."), 'js' => false ); + + if ($AllowSpamFilters) { + $optpage_blocks[] = array( + 'name' => _("SPAM Filters"), + 'url' => '../plugins/filters/spamoptions.php', + 'desc' => _("SPAM filters allow you to select from various DNS based blacklists to detect junk email in your INBOX and move it to another folder (like Trash)."), + 'js' => false + ); + } } ?>