X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffilters%2Fspamoptions.php;h=1026e755895a06a5771030c838e0dcbd95e8ed67;hp=da7209b4cfbb743ebd753f0064b48e9a9030de5e;hb=bbb2bab55dbfb58735b8aa3eab53c052410753fa;hpb=5b4ba967c2353d583ae6f010a3bf51a86febc057 diff --git a/plugins/filters/spamoptions.php b/plugins/filters/spamoptions.php index da7209b4..1026e755 100644 --- a/plugins/filters/spamoptions.php +++ b/plugins/filters/spamoptions.php @@ -1,66 +1,55 @@ $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']); } @@ -78,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); @@ -101,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' ) ); @@ -150,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(); @@ -207,7 +193,7 @@ if (! isset($_GET['action']) || $_GET['action'] != 'spam') { echo _("OFF"); } - echo '' . + echo '' . html_tag( 'td', ' - ', 'left' ) . html_tag( 'td', '', 'left' ); @@ -224,7 +210,6 @@ if (! isset($_GET['action']) || $_GET['action'] != 'spam') { echo "\n"; } echo '
'; - echo ''; } - -?> \ No newline at end of file +?> +