Removing test file.
[squirrelmail.git] / src / addressbook.php
index 78eefe635a9c9236490c6a5527641798a7727e3f..5e80b335276354021f852a5101582abbf85d9016 100644 (file)
@@ -2,6 +2,9 @@
    /**
     **  addressbook.php
     **
+    **  Copyright (c) 1999-2000 The SquirrelMail development team
+    **  Licensed under the GNU GPL. For full terms see the file COPYING.
+    **
     **  Manage personal address book.
     **
     **/
 
    // Display the address management part
    if($showaddrlist) {
-      printf("<FORM ACTION=\"%s\" METHOD=\"POST\">\n", $PHP_SELF);
-
       // Get and sort address list
       $alist = $abook->list_addr();
+      if(!is_array($alist)) {
+       plain_error_message($abook->error, $color);
+       exit;
+      }
+
       usort($alist,'alistcmp');
       $prevbackend = -1;
       $headerprinted = false;
 
       // List addresses
-      while(list($key,$row) = each($alist)) {
+      printf("<FORM ACTION=\"%s\" METHOD=\"POST\">\n", $PHP_SELF);
+      while(list($undef,$row) = each($alist)) {
 
         // New table header for each backend
         if($prevbackend != $row["backend"]) {
 
 
    // Display the "new address" form
-   printf("<FORM ACTION=\"%s\" METHOD=\"POST\">\n", $PHP_SELF);
+   printf("<FORM ACTION=\"%s\" NAME=f_add METHOD=\"POST\">\n", $PHP_SELF);
    print "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
    print "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n<STRONG>";
    printf(_("Add to %s"), $abook->localbackendname);
    address_form("addaddr", _("Add address"), $defdata);
    print "</FORM>";
 
+   // Add hook for anything that wants on the bottom
+   do_hook("addressbook_bottom");
 ?>
 
 </BODY></HTML>