From 6e79bfe2ddadf23c78b15977f153ee53fcd5d170 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Fri, 11 Aug 2000 19:21:34 +0000 Subject: [PATCH] improved html address book git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@707 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 5 +- src/addrbook_search_html.php | 138 +++++++++++++++++++---------------- src/compose.php | 29 ++++---- 3 files changed, 91 insertions(+), 81 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50aea57c..a4f62ac4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,12 @@ Version 0.5pre2 -- DEVELOPMENT ------------------------------ +- Improved HTML address book +- Fixed bugs in parsing email addresses in smtp.php - Applied fixes for Courier IMAP server (by Andreas Dahl) - Fixed some buggy IMAP handling - Improved word wrapping -- Made message highlighting not case sensative +- Fixed bugs with adding and not adding backslashes +- Made message highlighting case insensative - Added French translation from Ali Nedjimi diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index cd8fb2ca..95b93fcc 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -41,15 +41,16 @@ function addr_insert_hidden() { global $body, $subject, $send_to, $send_to_cc, $send_to_bcc; printf("\n", - htmlspecialchars($body)); + htmlspecialchars($body)); printf("\n", - htmlspecialchars($subject)); + htmlspecialchars($subject)); printf("\n", - htmlspecialchars($send_to)); + htmlspecialchars($send_to)); printf("\n", - htmlspecialchars($send_to_cc)); + htmlspecialchars($send_to_cc)); printf("\n", - htmlspecialchars($send_to_bcc)); + htmlspecialchars($send_to_bcc)); + printf("\n"); } @@ -60,18 +61,18 @@ if(sizeof($res) <= 0) return; printf('
'."\n", - $PHP_SELF); + $PHP_SELF); addr_insert_hidden(); $line = 0; print ""; printf("\n"; @@ -83,18 +84,18 @@ "%s". "\n"; + htmlspecialchars($row["email"]), htmlspecialchars($row["email"]), + $row["name"], $row["email"], $row["label"]); + if($includesource) + printf("\n"; $line++; } printf('', - 4 + ($includesource ? 1 : 0), - _("Use Addresses")); + 'NAME="addr_search_done" VALUE="%s">', + 4 + ($includesource ? 1 : 0), + _("Use Addresses")); print "
 ". - " %s %s". - " %s", - _("Name"), _("E-mail"), _("Info")); + " %s %s". + " %s", + _("Name"), _("E-mail"), _("Info")); if($includesource) - printf(" %s", _("Source")); + printf(" %s", _("Source")); print "
 %s ", ($line % 2) ? " bgcolor=\"$color[0]\"" : "", - htmlspecialchars($row["email"]), htmlspecialchars($row["email"]), - $row["name"], $row["email"], $row["label"]); - if($includesource) - printf(" %s", $row["source"]); - - print "
 %s", $row["source"]); + + print "
"; print ''; print "
"; @@ -113,47 +114,51 @@ $send_to_bcc = sqStripSlashes($send_to_bcc); $subject = sqStripSlashes($subject); +?> - // Header - print "\n"; - printf('', - $color[0], _("Address Book Search")); - print "
%s
\n"; +
+ +
+
+
+\n"; - printf('
'."\n", - $PHP_SELF); print "\n"; printf("
\n"); - printf(" %s\n", _("Search for")); + printf(''."\n", $PHP_SELF); + print "
\n"; + printf(" %s\n", _("Search for")); + addr_insert_hidden(); printf(" \n", - htmlspecialchars($addrquery)); + htmlspecialchars($addrquery)); // List all backends to allow the user to choose where to search if($abook->numbackends > 1) { printf("%s \n"); } else { printf("\n"); } printf("", - _("Search")); + _("Search")); printf(" | \n", - _("List all")); + _("List all")); + print "
"; + printf("
\n"); addr_insert_hidden(); - print ""; print ""; do_hook("addrbook_html_search_below"); // End search form @@ -162,24 +167,25 @@ if(!isset($addrquery) || !empty($listall)) { if($backend != -1 || !isset($addrquery)) { - if(!isset($addrquery)) - $backend = $abook->localbackend; + if(!isset($addrquery)) + $backend = $abook->localbackend; - //printf("

%s

\n", $abook->backends[$backend]->sname); + //printf("

%s

\n", $abook->backends[$backend]->sname); - $res = $abook->list_addr($backend); + $res = $abook->list_addr($backend); - if(is_array($res)) { - addr_display_result($res, false); - } else { - printf("

"._("Unable to list addresses from %s"). - "

\n", $abook->backends[$backend]->sname); - } + if(is_array($res)) { + addr_display_result($res, false); + } else { + printf("

"._("Unable to list addresses from %s"). + "

\n", $abook->backends[$backend]->sname); + } } else { - $res = $abook->list_addr(); - addr_display_result($res, true); + $res = $abook->list_addr(); + addr_display_result($res, true); } + exit; } else @@ -187,26 +193,30 @@ if(!empty($addrquery) && empty($listall)) { if($backend == -1) { - $res = $abook->s_search($addrquery); + $res = $abook->s_search($addrquery); } else { - $res = $abook->s_search($addrquery, $backend); + $res = $abook->s_search($addrquery, $backend); } if(!is_array($res)) { - printf("


%s:
%s

\n\n", - _("Your search failed with the following error(s)"), - $abook->error); - exit; - } - - if(sizeof($res) == 0) { - printf("


%s.

\n\n", - _("No persons matching your search was found")); - exit; + printf("


%s:
%s

\n\n", + _("Your search failed with the following error(s)"), + $abook->error); + } else if(sizeof($res) == 0) { + printf("


%s.

\n\n", + _("No persons matching your search was found")); + } else { + addr_display_result($res); } - - addr_display_result($res); } + if (!$addrquery || sizeof($res) == 0) { + printf('
'."\n", $PHP_SELF); + addr_insert_hidden(); + printf("\n", _("Return")); + printf('
'); + printf("
"); + } + ?> diff --git a/src/compose.php b/src/compose.php index 0e7dcfbe..ab43ce5f 100644 --- a/src/compose.php +++ b/src/compose.php @@ -45,6 +45,7 @@ $send_to = sqStripSlashes(decodeHeader($send_to)); $send_to_cc = sqStripSlashes(decodeHeader($send_to_cc)); + $send_to_bcc = sqStripSlashes(decodeHeader($send_to_bcc)); if ($forward_id) $id = $forward_id; @@ -97,8 +98,6 @@ return $body; } - $send_to = sqStripSlashes($send_to); - if (!$send_to) { $send_to = sqimap_find_email($send_to); } @@ -136,7 +135,7 @@ global $send_to, $send_to_cc, $reply_subj, $forward_subj, $body, $passed_body, $color, $use_signature, $signature, $editor_size, $attachments, $subject, $newmail, $use_javascript_addr_book, - $send_to_bcc, $reply_id, $mailbox; + $send_to_bcc, $reply_id, $mailbox, $from_htmladdr_search; $subject = sqStripSlashes(decodeHeader($subject)); $reply_subj = decodeHeader($reply_subj); @@ -157,7 +156,7 @@ //echo "\n
\n"; if ($reply_id) { echo "\n"; - } + } printf("\n", htmlspecialchars($mailbox)); echo "\n"; echo " \n"; @@ -165,7 +164,7 @@ echo _("To:"); echo " \n"; echo " \n"; echo " \n"; @@ -173,7 +172,7 @@ echo _("CC:"); echo " \n"; echo " \n"; echo " \n"; @@ -181,7 +180,7 @@ echo _("BCC:"); echo " \n"; echo " \n"; @@ -195,7 +194,7 @@ if (substr(strtolower($reply_subj), 0, 3) != "re:") $reply_subj = "Re: $reply_subj"; printf(" ", - htmlspecialchars($reply_subj)); + htmlspecialchars($reply_subj)); } else if ($forward_subj) { $forward_subj = str_replace("\"", "'", $forward_subj); $forward_subj = sqStripSlashes($forward_subj); @@ -205,10 +204,10 @@ (substr(strtolower($forward_subj), 0, 6) != "[ fwd:")) $forward_subj = "[Fwd: $forward_subj]"; printf(" ", - htmlspecialchars($forward_subj)); + htmlspecialchars($forward_subj)); } else { - printf(" ", - htmlspecialchars($subject)); + printf(" ", + htmlspecialchars($subject)); } echo "\n\n"; @@ -233,10 +232,10 @@ echo " \n"; echo " \n"; @@ -318,11 +317,9 @@ is_logged_in(); displayPageHeader($color, $mailbox); - $body = sqStripSlashes($body); $send_to = sqStripSlashes($send_to); $send_to_cc = sqStripSlashes($send_to_cc); $send_to_bcc = sqStripSlashes($send_to_bcc); - $subject = sqStripSlashes($subject); for ($i=0; $i < count($send_to_search); $i++) { if ($send_to) -- 2.25.1
\n"; printf("
\n", - htmlspecialchars($send_to)); + htmlspecialchars($send_to)); echo "
\n"; printf("
\n", - htmlspecialchars($send_to_cc)); + htmlspecialchars($send_to_cc)); echo "
\n"; printf("
\n", - htmlspecialchars($send_to_bcc)); + htmlspecialchars($send_to_bcc)); echo "
\n"; echo "   
\n"; echo "