edit-alias.php

- get domain name by splitting address parameter instead of relying
  on the domain GET/POST parameter. 
  This makes linking to edit-alias easier.
- simplify reading $_GET/$_POST['address']



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@749 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 15 years ago
parent 7f4f8fd996
commit 2c4cdca5fd

@ -39,16 +39,10 @@ if($CONF['alias_control_admin'] == 'NO' && !authentication_has_role('global-admi
}
/* retrieve existing alias record for the user first... may be via GET or POST */
if(isset($_GET['address']) && isset($_GET['domain'])) {
$fAddress = escape_string($_GET['address']);
$fDomain = escape_string($_GET['domain']);
}
elseif(isset($_POST['address']) && isset($_POST['domain'])) {
$fAddress = escape_string($_POST['address']);
$fDomain = escape_string($_POST['domain']);
}
else {
$fAddress = safepost('address', safeget('address')); # escaped below
$fDomain = escape_string(preg_replace("/.*@/", "", $fAddress));
$fAddress = escape_string($fAddress); # escaped now
if ($fAddress == "") {
die("Required parameters not present");
}
@ -88,7 +82,7 @@ if ($result['rows'] == 1)
}
}
else {
die("Invalid alias / domain combination");
die("Invalid alias");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")

Loading…
Cancel
Save