X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search.php;h=6c42aa1804c2b36fc74da7d8e893bad2384f5e99;hb=541506f3bbe3cfc966221c55c35e50e9bda6f181;hp=5181632c238ea4a78ce0b6ff5880b5ad2da49c6a;hpb=2a32fc83f95eba42be0d1752ef685adf10e1edc9;p=squirrelmail.git diff --git a/src/addrbook_search.php b/src/addrbook_search.php index 5181632c..6c42aa18 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -2,92 +2,30 @@ /** ** addrbook_search.php ** + ** Copyright (c) 1999-2000 The SquirrelMail development team + ** Licensed under the GNU GPL. For full terms see the file COPYING. + ** ** Handle addressbook searching in the popup window. ** + ** 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$ **/ - 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($strings_php)) - include("../functions/strings.php"); - if (!isset($imap_php)) - include("../functions/imap.php"); - if (!isset($page_header_php)) - include("../functions/page_header.php"); - if (!isset($addressbook_php)) - include("../functions/addressbook.php"); - - // Authenticate user and load prefs - $imapConnection = sqimap_login($username, $key, - $imapServerAddress, $imapPort, 10); - include("../src/load_prefs.php"); - sqimap_logout ($imapConnection); - -?> - - - -
-
%s
%s
"._("Unable to list addresses from %s"). + "
\n", $abook->backends[$backend]->sname); + } + + } else { + $res = $abook->list_addr(); + display_result($res, true); + } + + } else // Do the search - if(!empty($query)) { - $abook = addressbook_init(); - $res = $abook->s_search($query); + if(!empty($query) && empty($listall)) { + + if($backend == -1) { + $res = $abook->s_search($query); + } else { + $res = $abook->s_search($query, $backend); + } if(!is_array($res)) { - printf("
%s:
%s