X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffilters%2Fspamoptions.php;h=bcef8e51addffabfce244b1c75aba5bdb9f4ef8a;hp=7f6491c79fb0df3dffd4c84a067c7add332cbd2a;hb=7af343f176b34839e17d03e5f2ea9dc45b56f6d2;hpb=dcc1cc825e550711d0207a737f9ea3ac2b38e923 diff --git a/plugins/filters/spamoptions.php b/plugins/filters/spamoptions.php index 7f6491c7..bcef8e51 100644 --- a/plugins/filters/spamoptions.php +++ b/plugins/filters/spamoptions.php @@ -1,47 +1,25 @@ $Value) { $input = $spam_filters[$Key]['prefname'] . '_set'; - if ( isset( $_POST[$input] ) ) { - setPref( $data_dir, $username, $spam_filters[$Key]['prefname'], - $_POST[$input]); + if ( sqgetGlobalVar($input,$input_key,SQ_POST) ) { + setPref( $data_dir, $username, $spam_filters[$Key]['prefname'],$input_key); } else { removePref($data_dir, $username, $spam_filters[$Key]['prefname']); } @@ -75,17 +67,17 @@ echo html_tag( 'table', 'center', $color[0], 'width="95%" border="0" cellpadding="2" cellspacing="0"' ); if ($SpamFilters_YourHop == ' ') { - echo '
' . + echo '
' . html_tag( 'div', '' . - _("WARNING! Tell your admin to set the SpamFilters_YourHop variable") . + sprintf(_("WARNING! Tell the administrator to set the %s variable."), '"SpamFilters_YourHop"') . '' , 'center' ) . - '
'; + '
'; } if (isset($action) && $action == 'spam') { - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); $boxes = sqimap_mailbox_list($imapConnection); sqimap_logout($imapConnection); $numboxes = count($boxes); @@ -98,11 +90,11 @@ if (isset($action) && $action == 'spam') { } } - echo '
'. - '
'. + echo ''. + '
'. html_tag( 'table', '', '', '', 'width="85%" border="0" cellpadding="2" cellspacing="0"' ) . html_tag( 'tr' ) . - html_tag( 'th', _("Move spam to:"), 'right', '', 'nowrap' ) . + html_tag( 'th', _("Move spam to:"), 'right', '', 'style="white-space: nowrap;"' ) . html_tag( 'td', '', 'left' ) . ''. ''. '' . + echo '>' . _("Unread messages only") . '' . ''. ''. ''. html_tag( 'tr', html_tag( 'td', ' ' ) . html_tag( 'td', - _("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.") , + _("The more messages scanned, the longer it takes. It's recommended to scan unread messages only. If a change to the filters is made, it's recommended to set it to scan all messages, then go view the INBOX, then come back and set it to scan unread messages only. That way, the new spam filters will be applied and even the spam you didn't catch with the old filters will be scanned.") , 'left' ) ); @@ -147,15 +139,15 @@ if (isset($action) && $action == 'spam') { foreach ($spam_filters as $Key => $Value) { echo html_tag( 'tr' ) . - html_tag( 'th', $Key, 'right', '', 'nowrap' ) ."\n" . + html_tag( 'th', $Key, 'right', '', 'style="white-space: nowrap;"' ) ."\n" . html_tag( 'td' ) . - ' - '; + echo ' /> - '; if ($spam_filters[$Key]['link']) { echo '', 'center', '', 'colspan="2"' ) + html_tag( 'td', '', 'center', '', 'colspan="2"' ) ) . "\n" . ''. - '
'. + ''. ''; - echo ''; -} - -if (! isset($_GET['action']) || $_GET['action'] != 'spam') { - +} else { + // action is not set or action is not spam echo html_tag( 'p', '', 'center' ) . '[
' . _("Edit") . ']' . - ' - [' . _("Done") . ']

'; - 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") ) ); + ' - [' . _("Done") . ']

'; + printf( _("Spam is sent to %s."), ($filters_spam_folder?''.htmlspecialchars(imap_utf7_decode_local($filters_spam_folder)).'':'['._("not set yet").']' ) ); + echo '
'; + printf( _("Spam scan is limited to %s."), '' . ( ($filters_spam_scan == 'new')?_("Unread messages only"):_("All messages") ) . '' ); echo '

'. - ""; + '
\n"; $spam_filters = load_spam_filters(); @@ -204,7 +193,7 @@ if (! isset($_GET['action']) || $_GET['action'] != 'spam') { echo _("OFF"); } - echo '' . + echo '' . html_tag( 'td', ' - ', 'left' ) . html_tag( 'td', '', 'left' ); @@ -221,7 +210,6 @@ if (! isset($_GET['action']) || $_GET['action'] != 'spam') { echo "\n"; } echo '
'; - echo ''; } - -?> \ No newline at end of file +?> +