From a51f9f4b4eed91ac80a85dbca1ce473b6f4b3dde Mon Sep 17 00:00:00 2001 From: pallo Date: Thu, 30 Mar 2000 21:41:00 +0000 Subject: [PATCH] Fixed error handling and improved output. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@362 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/addrbook_search.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/addrbook_search.php b/src/addrbook_search.php index df111842..a2a011b4 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -142,6 +142,13 @@ function bcc_address($addr) { $res = $abook->s_search($query); 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; @@ -149,14 +156,19 @@ function bcc_address($addr) { // List search results $line = 0; - print ""; + print "
"; printf("\n", + "\n", _("Name"), _("E-mail"), _("Info"), _("Source")); while(list($key, $row) = each($res)) { - printf("\n", + printf("\n", ($line % 2) ? " bgcolor=\"$color[0]\"" : "", $row["email"], $row["email"], $row["name"], $row["email"], $row["label"], $row["source"]); -- 2.25.1
 ". - "%s%s%s". - "%s
 %s %s". + " %s". + " %s
To | Cc%s %s %s %s
". + "To | ". + "Cc". + " %s  %s ". + " %s  %s