X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_identities.php;h=5744561c88901214b0188f1de13b970bafe1e38c;hb=0b5eb0342e9ee4ef3541d8c164dd6273a45e23e3;hp=25e087ae5d89a4527fc720b3038240cca756ad51;hpb=545238b1fa274274c9202937c6e82c6432efc45d;p=squirrelmail.git diff --git a/src/options_identities.php b/src/options_identities.php index 25e087ae..5744561c 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -3,44 +3,63 @@ /** * options_identities.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2005 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Display Identities Options * - * $Id$ + * @version $Id$ + * @package squirrelmail */ -require_once('../src/validate.php'); -require_once('../functions/display_messages.php'); -require_once('../functions/html.php'); +/** + * Path for SquirrelMail required files. + * @ignore + */ +define('SM_PATH','../'); + +/* SquirrelMail required files. */ +require_once(SM_PATH . 'include/validate.php'); +require_once(SM_PATH . 'functions/global.php'); +require_once(SM_PATH . 'functions/display_messages.php'); +require_once(SM_PATH . 'functions/html.php'); + +/* POST data var names are dynamic because + of the possible multiple idents so lets get + them all + FIXME! This circumvents the benefits of rg=0 +*/ +if (!empty($_POST)) { + extract($_POST); +} +/* got 'em all */ if (isset($return)) { SaveUpdateFunction(); - header('Location: options_personal.php'); + header('Location: '.get_location().'/options_personal.php'); exit(); } - + displayPageHeader($color, 'None'); - + $Info = do_hook('options_identities_process', 0); if ($Info[1]) { SaveUpdateFunction(); } - + if (CheckAndDoDefault() || CheckAndDoPromote()) { SaveUpdateFunction(); } if (isset($update) || CheckForDelete()) { SaveUpdateFunction(); } - + do_hook('options_identities_top'); LoadInfo($full_name, $email_address, $reply_to, $signature, ''); $td_str = ''; - $td_str .= '

'; + $td_str .= '
'; $td_str .= ShowTableInfo($full_name, $email_address, $reply_to, $signature, ''); - + $num = 1; while (LoadInfo($full_name, $email_address, $reply_to, $signature, $num)) { $td_str .= html_tag( 'tr', @@ -50,11 +69,11 @@ require_once('../functions/html.php'); $num ++; } - echo '
' . + echo '
' . html_tag( 'table', "\n" . html_tag( 'tr', "\n" . html_tag( 'td', "\n" . - ''. _("Options") . ' - ' . _("Advanced Identities") .'
' . + ''. _("Options") . ' - ' . _("Advanced Identities") .'
' . html_tag( 'table', "\n" . html_tag( 'tr', "\n" . html_tag( 'td', "\n" . @@ -142,7 +161,7 @@ require_once('../functions/html.php'); setPref($data_dir, $username, 'email_address', $email_address); setPref($data_dir, $username, 'reply_to', $reply_to); setSig($data_dir, $username, "g", $signature); - + } function CheckAndDoDefault() { @@ -233,14 +252,14 @@ require_once('../functions/html.php'); $temp = $$nameA; $$nameA = $$nameB; $$nameB = $temp; - + $nameA = 'email_address' . $i; $nameB = 'email_address' . ($i - 1); global $$nameA, $$nameB; $temp = $$nameA; $$nameA = $$nameB; $$nameB = $temp; - + $nameA = 'reply_to' . $i; $nameB = 'reply_to' . ($i - 1); global $$nameA, $$nameB; @@ -281,15 +300,15 @@ require_once('../functions/html.php'); function sti_input( $title, $hd, $data, $post, $bg ) { $return_val = html_tag( 'tr', - html_tag( 'td', $title . ':', 'right', '', 'nowrap' ) . - html_tag( 'td', '' , 'left' ) , + html_tag( 'td', $title . ':', 'right', '', 'style="white-space: nowrap;"' ) . + html_tag( 'td', '' , 'left' ) , '', $bg ); return ($return_val); } function sti_textarea( $title, $hd, $data, $post, $bg ) { $return_val = html_tag( 'tr', - html_tag( 'td', $title . ':', 'right', '', 'nowrap' ) . + html_tag( 'td', $title . ':', 'right', '', 'style="white-space: nowrap;"' ) . html_tag( 'td', '' , 'left' ) , '', $bg ); return ($return_val); @@ -313,25 +332,25 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $signature, $post) $return_val .= sti_input( _("Reply To"), 'reply_to', $reply_to, $post, $OtherBG ); $return_val .= sti_textarea( _("Signature"), 'signature', $signature, $post, $OtherBG ); - do_hook('options_identities_table', $OtherBG, $isEmptySection, $post); + $return_val .= concat_hook_function('options_identities_table', array($OtherBG, $isEmptySection, $post)); $return_val .= html_tag( 'tr', '', '', $OtherBG); $return_val .= html_tag( 'td', ' ', 'left' ); $return_val .= html_tag( 'td', '', 'left' ); - $return_val .= ''; - $return_val .= ''; + $return_val .= ''; + $return_val .= ''; if (! $isEmptySection && $post != '') { $return_val .= ''. - ''; + _("Make Default") . '" />'. + ''; } if (! $isEmptySection && $post != '' && $post > 1) { - $return_val .= ''; + $return_val .= ''; } - do_hook('options_identities_buttons', $isEmptySection, $post); + $return_val .= concat_hook_function('options_identities_buttons', array($isEmptySection, $post)); $return_val .= ''. html_tag( 'tr', html_tag( 'td', ' ', 'left', '', 'colspan="2"' ));