X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_identities.php;h=bb9dcaeb194d972a6eaa3e1a0a7b6dd9f5f18c85;hb=b1dcab7e911330c60f96350e79eb61857e437c8c;hp=d052ba01f5067e1265513a4f1f085ee1f7a864ca;hpb=e7f9c98704ebe1b0a62912059c39c3cb44eff7ad;p=squirrelmail.git diff --git a/src/options_identities.php b/src/options_identities.php index d052ba01..bb9dcaeb 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -3,28 +3,33 @@ /** * options_identities.php * - * Copyright (c) 1999-2005 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * Display Identities Options * + * @copyright © 1999-2007 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail * @subpackage prefs + * @since 1.1.3 */ +/** This is the options_identities page */ +define('PAGE_NAME', 'options_identities'); + /** - * Path for SquirrelMail required files. - * @ignore + * Include the SquirrelMail initialization file. */ -define('SM_PATH','../'); +require('../include/init.php'); /* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); -include_once(SM_PATH . 'functions/global.php'); -include_once(SM_PATH . 'functions/display_messages.php'); -include_once(SM_PATH . 'functions/html.php'); -include_once(SM_PATH . 'functions/identity.php'); +require_once(SM_PATH . 'functions/identity.php'); + +/* make sure that page is not available when $edit_identity is false */ +if (!$edit_identity) { + error_box(_("Editing identities is disabled.")); + $oTemplate->display('footer.tpl'); + die(); +} if (!sqgetGlobalVar('identities', $identities, SQ_SESSION)) { $identities = get_identities(); @@ -43,8 +48,8 @@ if (!empty($smaction) && is_array($smaction)) { // we only need to extract the action and the identity we are // altering - foreach($row as $key=>$data) { - $identid = $key; + foreach($row as $iKey=>$data) { + $identid = $iKey; } $doaction = $action; @@ -59,50 +64,74 @@ if (!empty($return)) { exit; } -displayPageHeader($color, 'None'); +displayPageHeader($color); + +/* since 1.1.3 */ +do_hook('options_identities_top', $null); + +$i = array(); +foreach ($identities as $key=>$ident) { + $a = array(); + $a['Title'] = $key==0 ? _("Default Identity") : sprintf(_("Alternate Identity %d"), $key); + $a['New'] = false; + $a['Default'] = $key==0; + $a['FullName'] = htmlspecialchars($ident['full_name']); + $a['Email'] = htmlspecialchars($ident['email_address']); + $a['ReplyTo'] = htmlspecialchars($ident['reply_to']); + $a['Signature'] = htmlspecialchars($ident['signature']); + $i[$key] = $a; +} -do_hook('options_identities_top'); +$a = array(); +$a['Title'] = _("Add New Identity"); +$a['New'] = true; +$a['Default'] = false; +$a['FullName'] = ''; +$a['Email'] = ''; +$a['ReplyTo'] = ''; +$a['Signature'] = ''; +$i[count($i)] = $a; -$td_str = ''; -$td_str .= '
'; - -echo '