X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Foptions_identities.php;h=db9b053156771249b81718be802717ee620082b1;hp=a8c0e653880fb4c9b29adac3cc7afa6a8547a359;hb=7fc4b14fdb798a7b1c1d003163afa5865cce01f4;hpb=ca479ad18c00a6a4ff2ddfb58a2f0af40bc81379 diff --git a/src/options_identities.php b/src/options_identities.php index a8c0e653..db9b0531 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -3,14 +3,14 @@ /** * 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-2006 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 */ /** @@ -24,337 +24,201 @@ 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'); -/* 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); +if (!sqgetGlobalVar('identities', $identities, SQ_SESSION)) { + $identities = get_identities(); } -/* got 'em all */ +sqgetGlobalVar('newidentities', $newidentities, SQ_POST); +sqgetGlobalVar('smaction', $smaction, SQ_POST); +sqgetGlobalVar('return', $return, SQ_POST); - if (isset($return)) { - SaveUpdateFunction(); - header('Location: '.get_location().'/options_personal.php'); - exit(); - } +// First lets see if there are any actions to perform // +if (!empty($smaction) && is_array($smaction)) { - displayPageHeader($color, 'None'); + $doaction = ''; + $identid = 0; - $Info = do_hook('options_identities_process', 0); - if ($Info[1]) { - SaveUpdateFunction(); - } + foreach($smaction as $action=>$row) { + // we only need to extract the action and the identity we are + // altering - if (CheckAndDoDefault() || CheckAndDoPromote()) { - SaveUpdateFunction(); - } - if (isset($update) || CheckForDelete()) { - SaveUpdateFunction(); + foreach($row as $iKey=>$data) { + $identid = $iKey; + } + + $doaction = $action; } - do_hook('options_identities_top'); - LoadInfo($full_name, $email_address, $reply_to, $signature, ''); - $td_str = ''; - $td_str .= '