X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffilters%2Foptions.php;h=434bc98ce1876deaf17c9d25a2c0ad226afed640;hp=c5d076e35e030bf30ff28151a40d393a7481c467;hb=16dd8736f68b753f06df30ff39892ef18579e2ce;hpb=0a1dc88e11c9c6b1734eaa35849e3476dc425c6d
diff --git a/plugins/filters/options.php b/plugins/filters/options.php
index c5d076e3..434bc98c 100644
--- a/plugins/filters/options.php
+++ b/plugins/filters/options.php
@@ -1,53 +1,26 @@
'._("Saved Scan type")."\n";
- }
+} elseif (sqgetGlobalVar('user_submit',$user_submit,SQ_POST)) {
+ sqgetGlobalVar('filters_user_scan_set',$filters_user_scan_set,SQ_POST);
+ setPref($data_dir, $username, 'filters_user_scan', $filters_user_scan_set);
+ echo '
'._("Saved Scan type")."
\n";
+}
$filters = load_filters();
$filters_user_scan = getPref($data_dir, $username, 'filters_user_scan');
@@ -111,33 +91,32 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
echo html_tag( 'table',
html_tag( 'tr',
html_tag( 'td',
- '' . _("Options") . ' - ' . _("Message Filtering") . '' ,
- 'left', $color[0] )
- ) ,
- 'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) .
-
+ '' . _("Options") . ' - ' . _("Message Filtering") . '
' ,
+ 'left', $color[0]
+ )
+ ),
+ 'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"'
+ ) .
'
'.
html_tag( 'div', '[' . _("New") .
@@ -146,8 +125,15 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
if (isset($action) && ($action == 'add' || $action == 'edit')) {
- $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imapConnection);
+
+ for ($a = 0, $cnt = count($boxes); $a < $cnt; $a++) {
+ if (strtolower($boxes[$a]['formatted']) == 'inbox') {
+ unset($boxes[$a]);
+ }
+ }
+
sqimap_logout($imapConnection);
if ( !isset($theid) ) {
$theid = count($filters);
@@ -162,23 +148,29 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
$L = isset($filters[$theid]['where']);
- $sel = (($L && $filters[$theid]['where'] == 'From')?'selected':'');
- echo "';
+ $sel = (($L && $filters[$theid]['where'] == 'From')?' selected="selected"':'');
+ echo "';
+
+ $sel = (($L && $filters[$theid]['where'] == 'To')?' selected="selected"':'');
+ echo "';
- $sel = (($L && $filters[$theid]['where'] == 'To')?'selected':'');
- echo "';
+ $sel = (($L && $filters[$theid]['where'] == 'Cc')?' selected="selected"':'');
+ echo "';
- $sel = (($L && $filters[$theid]['where'] == 'Cc')?'selected':'');
- echo "';
+ $sel = (($L && $filters[$theid]['where'] == 'To or Cc')?' selected="selected"':'');
+ echo "';
- $sel = (($L && $filters[$theid]['where'] == 'To or Cc')?'selected':'');
- echo "';
+ $sel = (($L && $filters[$theid]['where'] == 'Subject')?' selected="selected"':'');
+ echo "';
- $sel = (($L && $filters[$theid]['where'] == 'Subject')?'selected':'');
- echo "';
+ $sel = (($L && $filters[$theid]['where'] == 'Message Body')?' selected="selected"':'');
+ echo "';
- $sel = (($L && $filters[$theid]['where'] == 'Header')?'selected':'');
- echo "';
+ $sel = (($L && $filters[$theid]['where'] == 'Header and Body')?' selected="selected"':'');
+ echo "';
+
+ $sel = (($L && $filters[$theid]['where'] == 'Header')?' selected="selected"':'');
+ echo "';
echo ''.
''.
@@ -188,7 +180,7 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
html_tag( 'td', '', 'left' ) .
''.
''.
@@ -202,19 +194,20 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
if ( isset($filters[$theid]['folder']) )
$selected = array(strtolower($filters[$theid]['folder']));
echo sqimap_mailbox_option_list(0, $selected, 0, $boxes);
- echo ''.
- ''.
+ echo ''.
+ ''.
''.
''.
''.
'\n".
- '\n".
+ addHidden('theid', $theid).
''.
'';
}
- echo html_tag( 'table', '', 'center', '', 'border="0" cellpadding="3" cellspacing="0"' );
+if (count($filters)) {
+ echo html_tag( 'table', '', 'center', '', 'border="0" cellpadding="3" cellspacing="0"' );
for ($i=0, $num = count($filters); $i < $num; $i++) {
@@ -230,33 +223,35 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
'' .
"[" . _("Delete") . ']'.
'' ,
- 'left' ) .
- html_tag( 'td', '', 'center' ) . '[';
-
- if (isset($filters[$i + 1])) {
- echo "" . _("Down") . '';
+ 'left' );
+
+ if ($num > 1) {
+ echo html_tag( 'td', '', 'center' ) . '[';
+ if (isset($filters[$i + 1])) {
+ echo "" . _("Down") . '';
+ if ($i > 0) {
+ echo ' | ';
+ }
+ }
if ($i > 0) {
- echo ' | ';
+ echo "" . _("Up") . '';
}
+ echo ']';
}
- if ($i > 0) {
- echo "" . _("Up") . '';
- }
- echo ']'.
- html_tag( 'td', '-', 'left' ) .
- html_tag( 'td', '', 'left' );
+ echo html_tag( 'td', '-', 'left' ) .
+ html_tag( 'td', '', 'left' );
printf( _("If %s contains %s then move to %s"),
- ''.$filters[$i]['where'].'',
- ''.$filters[$i]['what'].'',
- ''.imap_utf7_decode_local($fdr).'');
+ ''.$filters[$i]['where'].'',
+ ''.$filters[$i]['what'].'',
+ ''.htmlspecialchars(imap_utf7_decode_local($fdr)).'');
echo '';
}
- echo ''.
- html_tag( 'table',
+ echo '';
+}
+ echo html_tag( 'table',
html_tag( 'tr',
html_tag( 'td', ' ', 'left' )
) ,
'center', '', 'width="80%" border="0" cellpadding="2" cellspacing="0"' );
echo '