-fix for Bug 112604
[squirrelmail.git] / src / addrbook_search.php
index 66c484e43ba91790498f2208569d281c2db5b241..df487f719613bbcf80b4387dcadbd52e6c019d40 100644 (file)
@@ -2,6 +2,9 @@
    /**
     **  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
@@ -97,7 +100,7 @@ function bcc_address($addr) {
 
       print "</TR>\n";
       
-      while(list($key, $row) = each($res)) {
+      while(list($undef, $row) = each($res)) {
         printf("<tr%s nowrap><td valign=top nowrap align=center width=\"5%%\">".
                "<small><a href=\"javascript:to_address('%s');\">To</A> | ".
                "<a href=\"javascript:cc_address('%s');\">Cc</A> | ".
@@ -136,20 +139,17 @@ function bcc_address($addr) {
       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($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);
+   is_logged_in();
    include("../src/load_prefs.php");
-   sqimap_logout ($imapConnection);
 
    displayHtmlHeader();
 
@@ -190,7 +190,7 @@ function bcc_address($addr) {
         printf("<OPTION VALUE=-1 SELECTED>%s\n", 
                _("All address books"));
         $ret = $abook->get_backend_list();
-        while(list($k,$v) = each($ret)) 
+        while(list($undef,$v) = each($ret)) 
            printf("<OPTION VALUE=%d>%s\n", $v->bnum, $v->sname);
         printf("</SELECT>\n");
       } else {