X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Foptions_identities.php;h=bb9dcaeb194d972a6eaa3e1a0a7b6dd9f5f18c85;hp=5072dee6fa62d8f4e67a666042d920758d8a4068;hb=0bbf8622773554348ff9dc200e7e01411a81be0b;hpb=0f01b5d726463d32e9e521aa4fb03ba27890abc8 diff --git a/src/options_identities.php b/src/options_identities.php index 5072dee6..bb9dcaeb 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -3,29 +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(); @@ -44,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; @@ -60,67 +64,67 @@ if (!empty($return)) { exit; } -displayPageHeader($color, 'None'); +displayPageHeader($color); /* since 1.1.3 */ -do_hook('options_identities_top'); +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; +} -$td_str = ''; -$td_str .= '
'; - -echo '