create-domain.php: fix for bug 1831720

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@224 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 18 years ago
parent f1321de6b4
commit 9af76e13e4

@ -52,10 +52,11 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
if ($_SERVER['REQUEST_METHOD'] == "POST") if ($_SERVER['REQUEST_METHOD'] == "POST")
{ {
if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']);
foreach(array('fDescription' => '', 'fAliases' => '0', 'fMailboxes' => '0', $form_fields = array('fDescription' => '', 'fAliases' => '0', 'fMailboxes' => '0',
'fMaxquota' => '0', 'fTransport' => 'virtual', 'fMaxquota' => '0', 'fTransport' => 'virtual', 'fDefaultaliases' => '0',
'fDefaultaliases' => '0', 'fBackupmx' => '0') as $key => $default) { 'fBackupmx' => '0');
if(isset($_POST[$key]) && !empty($POST[$key])) { foreach($form_fields as $key => $default) {
if(isset($_POST[$key]) && (!empty($_POST[$key]))) {
$$key = escape_string($_POST[$key]); $$key = escape_string($_POST[$key]);
} }
else { else {
@ -63,6 +64,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
} }
} }
if (empty ($fDomain) or domain_exist ($fDomain) or !check_domain ($fDomain)) if (empty ($fDomain) or domain_exist ($fDomain) or !check_domain ($fDomain))
{ {
$error = 1; $error = 1;

Loading…
Cancel
Save