X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search.php;h=6c42aa1804c2b36fc74da7d8e893bad2384f5e99;hb=c45c3f60f4ff4c2140e1183177f587d8dedfd71b;hp=d89d118b5f4043f2c6d6b76dd571b0472a526a7f;hpb=ef8703220ec8e7573417b08881f636082e4b8d58;p=squirrelmail.git diff --git a/src/addrbook_search.php b/src/addrbook_search.php index d89d118b..6c42aa18 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -10,8 +10,12 @@ ** NOTE: A lot of this code is similar to the code in ** addrbook_search_html.html -- If you change one, ** change the other one too! + ** + ** $Id$ **/ + include("../src/validate.php"); + // Function to include JavaScript code function insert_javascript() { ?> @@ -89,7 +93,7 @@ function bcc_address($addr) { insert_javascript(); $line = 0; - print ""; + print '
'; printf("\n"; - while(list($key, $row) = each($res)) { + while(list($undef, $row) = each($res)) { printf("\n"; $line++; } - print "
 ". " %s %s". " %s", @@ -100,7 +104,7 @@ function bcc_address($addr) { print "
". "To | ". "Cc | ". @@ -119,45 +123,26 @@ function bcc_address($addr) { print "
"; + print ''; } /* ================= End of functions ================= */ - session_start(); - - if(!isset($logged_in)) { - echo _("You must login first."); - exit; - } - if(!isset($username) || !isset($key)) { - echo _("You need a valid user and password to access this page!"); - exit; - } - - if (!isset($config_php)) - include("../config/config.php"); - if (!isset($array_php)) - include("../functions/array.php"); - if (!isset($auth_php)) - include("../functions/auth.php"); - if (!isset($strings_php)) - include("../functions/strings.php"); - if (!isset($page_header_php)) - include("../functions/page_header.php"); - if (!isset($addressbook_php)) - include("../functions/addressbook.php"); - - is_logged_in(); - include("../src/load_prefs.php"); + include('../functions/array.php'); + include('../functions/strings.php'); + include('../functions/addressbook.php'); displayHtmlHeader(); + // Initialize vars + if(!isset($query)) $query = ""; + if(!isset($show)) $show = ""; + // Choose correct colors for top and bottom frame - if($show == "form") { + if($show == 'form') { echo ""; + echo 'OnLoad="document.sform.query.focus();">'; } else { echo "\n"; @@ -174,11 +159,11 @@ function bcc_address($addr) { $abook = addressbook_init(); // Create search form - if($show == "form") { + if($show == 'form') { printf("
\n", $PHP_SELF); - printf(""); - printf("
\n"); + print(''); + print("
\n"); printf(" %s\n", _("Search for")); printf(" \n", htmlspecialchars($query)); @@ -190,28 +175,28 @@ function bcc_address($addr) { printf("\n"); + print "\n"; printf("\n", _("Close window")); - printf("
\n"); + print "
\n"; } else // Show personal addressbook - if($show == "blank" || !empty($listall)) { + if($show == 'blank' || !empty($listall)) { - if($backend != -1 || $show == "blank") { - if($show == "blank") + if($backend != -1 || $show == 'blank') { + if($show == 'blank') $backend = $abook->localbackend; //printf("

%s

\n", $abook->backends[$backend]->sname);