Add ability to show login error from the IMAP server instead of traditional "Unknown...
[squirrelmail.git] / src / addrbook_search_html.php
index c9beedde0f3f66cb8f9155822617b270a313ee9e..f2bb292b1ea010ad24370cdd65fb0a9fcf16c062 100644 (file)
@@ -6,7 +6,7 @@
  *
  * This file is included from compose.php
  *
- * @copyright © 1999-2009 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 squirrelmail
@@ -43,7 +43,7 @@ sqgetGlobalVar('backend',   $backend,   SQ_POST);
  */
 function addr_insert_hidden() {
     global $body, $subject, $send_to, $send_to_cc, $send_to_bcc, $mailbox, $mailprio,
-           $request_mdn, $request_dr, $identity, $session, $composeMessage;
+           $request_mdn, $request_dr, $identity, $session, $composeMessage, $action;
 
 //FIXME Do not echo HTML from the core.  This file already uses templates mostly, so why are we echoing here at all?!?
    if (substr($body, 0, 1) == "\r") {
@@ -53,9 +53,10 @@ function addr_insert_hidden() {
    }
 
    if (is_object($composeMessage) && $composeMessage->entities)
-       echo addHidden('attachments', serialize($composeMessage->entities));
+       echo addHidden('attachments', urlencode(serialize($composeMessage->entities)));
 
    echo addHidden('session', $session).
+        addHidden('smaction', $action).
         addHidden('subject', $subject).
         addHidden('send_to', $send_to).
         addHidden('send_to_bcc', $send_to_bcc).
@@ -78,7 +79,8 @@ function addr_display_result($res, $includesource = true) {
     global $PHP_SELF, $oTemplate, $oErrorHandler;
     
 
-    echo addForm($PHP_SELF, 'post', 'addressbook').
+//FIXME: no HTML output from core
+    echo addForm($PHP_SELF, 'post', 'addressbook', '', '', array(), TRUE).
          addHidden('html_addr_search_done', 'true');
     addr_insert_hidden();
     
@@ -156,7 +158,7 @@ if ($addrquery == '' || ! empty($listall)) {
     }
 
     if (!is_array($res)) {
-        plain_error_message(_("Your search failed with the following error(s)") .':<br />'. nl2br(htmlspecialchars($abook->error)));
+        plain_error_message(_("Your search failed with the following error(s)") .':<br />'. nl2br(sm_encode_html_special_chars($abook->error)));
     } elseif (sizeof($res) == 0) {
         $oTemplate->assign('note', _("No persons matching your search were found"));
         $oTemplate->display('note.tpl');
@@ -172,7 +174,7 @@ if ($addrquery == '' || ! empty($listall)) {
 if ($addrquery == '' || sizeof($res) == 0) {
 //FIXME don't echo HTML from core -- especially convoluted given that there is template code immediately above AND below this block
     echo '<div style="text-align: center;">'.
-        addForm('compose.php','post','k');
+        addForm('compose.php','post','k', '', '', array(), TRUE);
     addr_insert_hidden();
     echo '<input type="submit" value="' . _("Return") . '" name="return" />' . "\n" .
          '</form></div></nobr>';