X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddressbook.php;h=923f85ec7552a2c5c251185fec9b452d96fc7776;hb=44c046311a3f62a461a82d31f792f3fc4421f820;hp=f81ae4eff092c11772a5eca868f1410a8c92bebd;hpb=ac987a56a67a53a01b7db77a02fdd9c9241b4549;p=squirrelmail.git diff --git a/src/addressbook.php b/src/addressbook.php index f81ae4ef..923f85ec 100644 --- a/src/addressbook.php +++ b/src/addressbook.php @@ -11,12 +11,16 @@ * $Id$ */ -require_once('../src/validate.php'); -require_once('../functions/array.php'); -require_once('../functions/display_messages.php'); -require_once('../functions/addressbook.php'); -require_once('../functions/strings.php'); -require_once('../functions/html.php'); +/* Path for SquirrelMail required files. */ +define('SM_PATH','../'); + +/* SquirrelMail required files. */ +require_once(SM_PATH . 'include/validate.php'); +require_once(SM_PATH . 'functions/array.php'); +require_once(SM_PATH . 'functions/display_messages.php'); +require_once(SM_PATH . 'functions/addressbook.php'); +require_once(SM_PATH . 'functions/strings.php'); +require_once(SM_PATH . 'functions/html.php'); /* Make an input field */ function adressbook_inp_field($label, $field, $name, $size, $values, $add) { @@ -49,7 +53,7 @@ function address_form($name, $submittext, $values = array()) { $submittext . '">', 'center', $color[4], 'colspan="2"') ) - , 'center', '', 'border="0" cellpadding="1" cols="2" width="90%"') ."\n"; + , 'center', '', 'border="0" cellpadding="1" width="90%"') ."\n"; } @@ -171,7 +175,7 @@ if($REQUEST_METHOD == 'POST') { "\n". '' . _("Update address") . '' ."\n", 'center', $color[0] ) ), - 'center', '', 'width="100%" cols="1"' ) . + 'center', '', 'width="100%" ' ); address_form("editaddr", _("Update address"), $olddata); echo '\n" . @@ -197,7 +201,7 @@ if($REQUEST_METHOD == 'POST') { '">' . _("ERROR") . ': ' . $abook->error . '' ."\n", 'center' ) ), - 'center', '', 'width="100%" cols="1"' ); + 'center', '', 'width="100%"' ); /* Display the "new address" form again */ echo '
' . _("Update address") . '' ."\n", 'center', $color[0] ) ), - 'center', '', 'width="100%" cols="1"' ) . + 'center', '', 'width="100%"' ) . address_form("editaddr", _("Update address"), $newdata); echo '\n" . @@ -251,7 +255,7 @@ if (!empty($formerror)) { '">' . _("ERROR") . ': ' . $formerror . '' ."\n", 'center' ) ), - 'center', '', 'width="100%" cols="1"' ); + 'center', '', 'width="100%"' ); } @@ -297,8 +301,8 @@ if ($showaddrlist) { html_tag( 'tr', html_tag( 'td', "\n" . '' . $row['source'] . '' . "\n", 'center', $color[0] ) ) , - 'center', '', 'width="95%" cols="1"' ) ."\n" - . html_tag( 'table', '', 'center', '', 'cols="5" border="0" cellpadding="1" cellspacing="0" width="90%"' ) . + 'center', '', 'width="95%"' ) ."\n" + . html_tag( 'table', '', 'center', '', 'border="0" cellpadding="1" cellspacing="0" width="90%"' ) . html_tag( 'tr', "\n" . html_tag( 'th', ' ', 'left', '', 'width="1%"' ) . html_tag( 'th', _("Nickname"), 'left', '', 'width="1%"' ) . @@ -332,14 +336,15 @@ if ($showaddrlist) { html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) . html_tag( 'td', ' ' . $row['name'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) . html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' '; + $email = $abook->full_address($row); if ($compose_new_win == '1') { - echo ''; + echo ''; } else { - echo ''; + echo ''; } - echo $row['email'] . ' '."\n". - html_tag( 'td', ' ' . $row['label'] . ' ', 'left', '', 'valign="top" width="1%"' ) . + echo htmlspecialchars($row['email']) . ' '."\n". + html_tag( 'td', ' ' . htmlspecialchars($row['label']) . ' ', 'left', '', 'valign="top" width="1%"' ) . "\n"; $line++; } @@ -369,7 +374,7 @@ echo '' . "\n" . 'center', $color[0] ) ) - , 'center', '', 'width="100%" cols="1"' ) ."\n"; + , 'center', '', 'width="100%"' ) ."\n"; address_form('addaddr', _("Add address"), $defdata); echo '
';