X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddressbook.php;h=d269fe5a95f156df3aa17e692bfb85a8b056aa37;hb=7aaa81fcf8383ee72ee0e4fd3cb2fd8d5f9708b5;hp=1caaee19ce1489bed173b9a2bdce2449903d5f39;hpb=9f2215a1f40978a370a7538229ca2f55f55026ee;p=squirrelmail.git diff --git a/src/addressbook.php b/src/addressbook.php index 1caaee19..d269fe5a 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -2,29 +2,23 @@ /** ** 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. ** **/ 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($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($display_messages_php)) @@ -32,6 +26,7 @@ if (!isset($addressbook_php)) include("../functions/addressbook.php"); + is_logged_in(); // Sort array by the key "name" function alistcmp($a,$b) { @@ -83,12 +78,7 @@ } - // IMAP Login - $imapConnection = sqimap_login ($username, $key, - $imapServerAddress, $imapPort, 10); include("../src/load_prefs.php"); - sqimap_logout ($imapConnection); - // Open addressbook, with error messages on but without LDAP (the // second "true"). Don't need LDAP here anyway @@ -98,13 +88,6 @@ exit(); } - print "\n"; - print "\n"; - printf("%s: %s\n", $org_title, _("Address Book")); - print "\n\n"; - - printf('', - $color[8], $color[4], $color[7], $color[7], $color[7]); displayPageHeader($color, "None"); @@ -300,7 +283,7 @@ $headerprinted = false; // List addresses - while(list($key,$row) = each($alist)) { + while(list($undef,$row) = each($alist)) { // New table header for each backend if($prevbackend != $row["backend"]) { @@ -315,12 +298,15 @@ print "\n\n"; print "\n"; - print ""; - printf("\n", - _("Nickname"), _("Name"), _("E-mail"), _("Info")); + print '
". - " %s%s". - "%s%s
'; + printf('\n", $color[9], "1%", + "1%", _("Nickname"), + "1%", _("Name"), + "1%", _("E-mail"), + "%", _("Info")); $line = 0; $headerprinted = true; } // End of header @@ -334,15 +320,20 @@ $selected = ""; // Print one row - printf("\n \n", - ($line % 2) ? " bgcolor=\"$color[0]\"" : "", - $selected, $row["backend"], $row["nickname"], - $row["nickname"], $row["name"], - rawurlencode($row["email"]), $row["email"], $row["label"]); + printf("", + (($line % 2) ? " bgcolor=\"$color[0]\"" : "")); + print '', + $selected, $row["backend"], $row["nickname"]); + printf(''. + '', + "1%", $row["nickname"], + "1%", $row["name"]); + printf(''."\n", + "1%", rawurlencode($row["email"]), $row["email"]); + printf('', + "%", $row["label"]); + print "\n"; $line++; } @@ -359,7 +350,7 @@ // Display the "new address" form - printf("\n", $PHP_SELF); + printf("\n", $PHP_SELF); print "
 '. + '%s%s'. + '%s%s'. + "
". - "". - " %s  %s ". - " %s". - "  %s
'; + printf(' %s  %s  %s  %s 
\n"; print "
\n"; printf(_("Add to %s"), $abook->localbackendname); @@ -368,6 +359,8 @@ address_form("addaddr", _("Add address"), $defdata); print ""; + // Add hook for anything that wants on the bottom + do_hook("addressbook_bottom"); ?>