Add ability to show login error from the IMAP server instead of traditional "Unknown...
[squirrelmail.git] / plugins / filters / options.php
index e9536d2ea067f9379bd47844e9180a0ff30e10a3..6ea5290ef83905d1e0b4d33c5cd6f7d00fb5338e 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Message and Spam Filter Plugin - Filtering Options
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2014 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -18,13 +18,14 @@ include_once(SM_PATH . 'functions/imap_general.php');
 include_once(SM_PATH . 'functions/forms.php');
 include_once(SM_PATH . 'plugins/filters/filters.php');
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 /* get globals */
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 
 sqgetGlobalVar('theid', $theid);
 sqgetGlobalVar('action', $action, SQ_GET);
+global $imapSslOptions; // in case not defined in config
 
 if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
 
@@ -52,7 +53,7 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
     }
 
     if ($complete_post) {
-        $filter_what = str_replace(',', ' ', $filter_what);
+        $filter_what = str_replace(',', '###COMMA###', $filter_what);
         $filter_what = str_replace("\\\\", "\\", $filter_what);
         $filter_what = str_replace("\\\"", '"', $filter_what);
         $filter_what = str_replace('"', '"', $filter_what);
@@ -125,7 +126,7 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
 
     if (isset($action) && ($action == 'add' || $action == 'edit')) {
 
-        $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
+        $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imapSslOptions);
         $boxes = sqimap_mailbox_list($imapConnection);
 
         for ($a = 0, $cnt = count($boxes); $a < $cnt; $a++) {
@@ -180,7 +181,7 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) {
                 html_tag( 'td', '', 'left' ) .
                     '<input type="text" size="32" name="filter_what" value="';
         if (isset($filters[$theid]['what'])) {
-            echo htmlspecialchars($filters[$theid]['what']);
+            echo sm_encode_html_special_chars($filters[$theid]['what']);
         }
         echo '" />'.
                 '</td>'.
@@ -243,7 +244,7 @@ if (count($filters)) {
         printf( _("If %s contains %s then move to %s"),
             '<b>'.$filters[$i]['where'].'</b>',
             '<b>'.$filters[$i]['what'].'</b>',
-            '<b>'.htmlspecialchars(imap_utf7_decode_local($fdr)).'</b>');
+            '<b>'.sm_encode_html_special_chars(imap_utf7_decode_local($fdr)).'</b>');
         echo '</td></tr>';
 
     }