X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddrbook_search_html.php;h=ac0be5609901293ef996935f7239efd147327d13;hb=7111b0daa5f74c1c96d3bcf87da7a05e4ba6e189;hp=c7062491e8a8283153f7550a10c8e06cbc034fad;hpb=355861846a51d35efe50848869d680fd3b4a5316;p=squirrelmail.git diff --git a/src/addrbook_search_html.php b/src/addrbook_search_html.php index c7062491..ac0be560 100644 --- a/src/addrbook_search_html.php +++ b/src/addrbook_search_html.php @@ -1,234 +1,286 @@ ' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo "' . "\n"; - echo "' . "\n"; - echo "' . "\n"; - echo "\n"; - echo "\n"; - } - +/** + * Include the SquirrelMail initialization file. + * Because this file can also be included within compose we check for the $bInit + * var which is set inside ini.php. It's needed because compose already includes + * init.php. + */ +if (!isset($bInit)) { + include('../include/init.php'); +} - // List search results - function addr_display_result($res, $includesource = true) { - global $color, $PHP_SELF; - - if(sizeof($res) <= 0) return; - - echo '
'; - } +/** SquirrelMail required files. */ +include_once(SM_PATH . 'functions/date.php'); +include_once(SM_PATH . 'functions/addressbook.php'); - // --- End functions --- +sqgetGlobalVar('session', $session, SQ_POST); +sqgetGlobalVar('mailbox', $mailbox, SQ_POST); +if (! sqgetGlobalVar('addrquery', $addrquery, SQ_POST)) + $addrquery=''; +sqgetGlobalVar('listall', $listall, SQ_POST); +sqgetGlobalVar('backend', $backend, SQ_POST); - global $mailbox; - displayPageHeader($color, $mailbox); +/** + * Insert hidden data + */ +function addr_insert_hidden() { + global $body, $subject, $send_to, $send_to_cc, $send_to_bcc, $mailbox, + $identity, $session; - // Initialize addressbook - $abook = addressbook_init(); + if (substr($body, 0, 1) == "\r") { + echo addHidden('body', "\n".$body); + } else { + echo addHidden('body', $body); + } -?> + echo addHidden('session', $session). + addHidden('subject', $subject). + addHidden('send_to', $send_to). + addHidden('send_to_bcc', $send_to_bcc). + addHidden('send_to_cc', $send_to_cc). + addHidden('identity', $identity). + addHidden('mailbox', $mailbox). + addHidden('from_htmladdr_search', 'true'); +} -
- |
\n"; - printf(''; - - print " |
"._("Unable to list addresses from %s"). - "
\n", $abook->backends[$backend]->sname); - } - - } else { - $res = $abook->list_addr(); - addr_display_result($res, true); - } - exit; - - } else - - // Do the search - if(!empty($addrquery) && empty($listall)) { - - if($backend == -1) { - $res = $abook->s_search($addrquery); - } else { - $res = $abook->s_search($addrquery, $backend); - } - - if(!is_array($res)) { - printf("
%s:
%s