X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search_html.php;h=9cdf82a9117fa2def492f898742fdac89fe5b84c;hb=541506f3bbe3cfc966221c55c35e50e9bda6f181;hp=95b93fccaffaf0fbca9cff6df01d7f1a58195a1a;hpb=6e79bfe2ddadf23c78b15977f153ee53fcd5d170;p=squirrelmail.git diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index 95b93fcc..9cdf82a9 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -12,45 +12,39 @@ ** NOTE: A lot of this code is similar to the code in ** addrbook_search.html -- If you change one, change ** the other one too! + ** + ** $Id$ **/ - session_start(); - - if (!isset($config_php)) - include("../config/config.php"); - if (!isset($strings_php)) - include("../functions/strings.php"); - if (!isset($auth_php)) - include("../functions/auth.php"); - if (!isset($page_header_php)) - include("../functions/page_header.php"); - if (!isset($date_php)) - include("../functions/date.php"); - if (!isset($smtp_php)) - include("../functions/smtp.php"); - if (!isset($display_messages_php)) - include("../functions/display_messages.php"); - if (!isset($addressbook_php)) - include("../functions/addressbook.php"); - if (!isset($plugin_php)) - include("../functions/plugin.php"); - - include("../src/load_prefs.php"); + include('../src/validate.php'); + include('../functions/date.php'); + include('../functions/smtp.php'); + include('../functions/display_messages.php'); + include('../functions/addressbook.php'); + include('../functions/plugin.php'); // Insert hidden data function addr_insert_hidden() { - global $body, $subject, $send_to, $send_to_cc, $send_to_bcc; - printf("\n", - htmlspecialchars($body)); - printf("\n", - htmlspecialchars($subject)); - printf("\n", - htmlspecialchars($send_to)); - printf("\n", - htmlspecialchars($send_to_cc)); - printf("\n", - htmlspecialchars($send_to_bcc)); - printf("\n"); + global $body, $subject, $send_to, $send_to_cc, $send_to_bcc, $mailbox, + $identity; + + echo '' . "\n"; + echo '' . "\n"; + echo '' . "\n"; + echo "' . "\n"; + echo "' . "\n"; + echo "' . "\n"; + echo "\n"; + echo "\n"; } @@ -60,8 +54,9 @@ if(sizeof($res) <= 0) return; - printf('
'."\n", - $PHP_SELF); + echo '\n"; + echo ''; + echo "\n"; addr_insert_hidden(); $line = 0; @@ -76,44 +71,41 @@ print "\n"; - while(list($undef, $row) = each($res)) { - printf("". - " To". - " Cc ". - " %s  ". - "%s". - " %s ", - ($line % 2) ? " bgcolor=\"$color[0]\"" : "", - htmlspecialchars($row["email"]), htmlspecialchars($row["email"]), - $row["name"], $row["email"], $row["label"]); + foreach ($res as $row) { + echo ''; + echo ' To '; + echo ' Cc '; + echo ' Bcc '; + echo ' ' . $row['name'] . ' '; + echo ' ' . $row['email'] . ' '; + echo ' ' . $row['label'] . ' '; if($includesource) - printf(" %s", $row["source"]); - - print "\n"; - $line++; + echo ' ' . $row['source'] . ' '; + echo "\n"; + $line ++; } printf('', 4 + ($includesource ? 1 : 0), _("Use Addresses")); - print ""; + print ''; print ''; - print ""; + print ''; } // --- End functions --- - displayPageHeader($color, "None"); - + global $mailbox; + displayPageHeader($color, $mailbox); + // Initialize addressbook $abook = addressbook_init(); - $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); - ?>
@@ -126,15 +118,18 @@ // Search form print "
\n"; print "\n"; - printf("
\n"); + print "
\n"; printf('
'."\n", $PHP_SELF); print "
\n"; printf(" %s\n", _("Search for")); addr_insert_hidden(); + if (! isset($addrquery)) + $addrquery = ''; printf(" \n", htmlspecialchars($addrquery)); // List all backends to allow the user to choose where to search + if(!isset($backend)) $backend = ""; if($abook->numbackends > 1) { printf("%s \n"); + print "\n"; } else { - printf("\n"); + print "\n"; } printf("", _("Search")); printf(" | \n", _("List all")); - print "
"; + print ''; - printf("
\n"); + print "\n"; addr_insert_hidden(); print "
"; - do_hook("addrbook_html_search_below"); + do_hook('addrbook_html_search_below'); // End search form // Show personal addressbook - if(!isset($addrquery) || !empty($listall)) { + if($addrquery == '' || !empty($listall)) { - if($backend != -1 || !isset($addrquery)) { - if(!isset($addrquery)) + if(! isset($backend) || $backend != -1 || $addrquery == '') { + if($addrquery == '') $backend = $abook->localbackend; //printf("

%s

\n", $abook->backends[$backend]->sname); @@ -210,12 +205,12 @@ } } - if (!$addrquery || sizeof($res) == 0) { + if ($addrquery == '' || sizeof($res) == 0) { printf('
'."\n", $PHP_SELF); addr_insert_hidden(); printf("\n", _("Return")); - printf('
'); - printf("
"); + print ''; + print ''; } ?>