X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Faddrbook_search.php;h=f820c4fccf612fe8fbe3c6f429a38b05bcb506b5;hp=cda2f1bc9cb0887ee50c96f7fed2b8321c0a4785;hb=caf0ab1de11a5cafc878e424ef0d55dbc0350dd1;hpb=12b4ef8b0689e6e2dbcc3c6f7605ca8e7d99e50d diff --git a/src/addrbook_search.php b/src/addrbook_search.php index cda2f1bc..f820c4fc 100644 --- a/src/addrbook_search.php +++ b/src/addrbook_search.php @@ -1,274 +1,144 @@ - - -'; - printf(" ". - " %s %s". - " %s", - _("Name"), _("E-mail"), _("Info")); - - if($includesource) - printf(" %s", _("Source")); - - print "\n"; - - while(list($undef, $row) = each($res)) { - printf("". - "To | ". - "Cc | ". - "Bcc". - " %s ". - " %s ". - " %s ", - ($line % 2) ? " bgcolor=\"$color[0]\"" : "", - $row["email"], $row["email"], $row["email"], - $row["name"], $row["email"], $row["email"], - $row["label"]); - - if($includesource) - printf(" %s", $row["source"]); - - print "\n"; - $line++; - } - print ''; - } - - /* ================= End of functions ================= */ - - session_start(); - - if (!isset($strings_php)) - include("../functions/strings.php"); - if (!isset($i18n_php)) - include('../functions/i18n.php'); - - if(!isset($logged_in) || !isset($username) || !isset($key)) { - include ('../themes/default_theme.php'); - include ('../functions/display_messages.php'); - printf('', - $color[8], $color[4], $color[7], $color[7], $color[7]); - plain_error_message(_("You need a valid user and password to access this page!") - . '
' - . _("Click here to log back in.") . ".", $color); - echo ''; - 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'); - - displayHtmlHeader(); - - // Initialize vars - if(!isset($query)) $query = ""; - if(!isset($show)) $show = ""; - - // Choose correct colors for top and bottom frame - if($show == 'form') { - echo "'; - } else { - echo "\n"; - } - - // Empty search - if(empty($query) && empty($show) && empty($listall)) { - printf("


%s

\n\n", - _("No persons matching your search was found")); - exit; - } - - // Initialize addressbook - $abook = addressbook_init(); - - // Create search form - if($show == 'form') { - printf("
\n", - $PHP_SELF); - print(''); - print("
\n"); - printf(" %s\n", _("Search for")); - printf(" \n", - htmlspecialchars($query)); - - // List all backends to allow the user to choose where to search - if($abook->numbackends > 1) { - printf("%s \n"; - } else { - print "\n"; - } - - printf("", - _("Search")); - printf(" | \n", - _("List all")); - print "\n"; - printf("\n", - _("Close window")); - print "
\n"; - } else - - // Show personal addressbook - if($show == 'blank' || !empty($listall)) { - - if($backend != -1 || $show == 'blank') { - if($show == 'blank') - $backend = $abook->localbackend; - - //printf("

%s

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

"._("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) && empty($listall)) { - - if($backend == -1) { - $res = $abook->s_search($query); - } else { - $res = $abook->s_search($query, $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; - } - - display_result($res); - } -?> - - +$oTemplate->display('footer.tpl');