Thread: SF.net SVN: postfixadmin: [223] trunk/create-domain.php
Brought to you by:
christian_boltz,
gingerdog
From: <Gin...@us...> - 2007-11-14 21:19:07
|
Revision: 223 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=223&view=rev Author: GingerDog Date: 2007-11-14 13:19:10 -0800 (Wed, 14 Nov 2007) Log Message: ----------- create-domain.php: fix for bug 1831720 Modified Paths: -------------- trunk/create-domain.php Modified: trunk/create-domain.php =================================================================== --- trunk/create-domain.php 2007-11-14 18:27:24 UTC (rev 222) +++ trunk/create-domain.php 2007-11-14 21:19:10 UTC (rev 223) @@ -58,7 +58,9 @@ if(isset($_POST[$key]) && !empty($POST[$key])) { $$key = escape_string($_POST[$key]); } - $$key = $default; + else { + $$key = $default; + } } if (empty ($fDomain) or domain_exist ($fDomain) or !check_domain ($fDomain)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Gin...@us...> - 2007-11-14 21:34:00
|
Revision: 224 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=224&view=rev Author: GingerDog Date: 2007-11-14 13:34:04 -0800 (Wed, 14 Nov 2007) Log Message: ----------- create-domain.php: fix for bug 1831720 Modified Paths: -------------- trunk/create-domain.php Modified: trunk/create-domain.php =================================================================== --- trunk/create-domain.php 2007-11-14 21:19:10 UTC (rev 223) +++ trunk/create-domain.php 2007-11-14 21:34:04 UTC (rev 224) @@ -52,10 +52,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); - foreach(array('fDescription' => '', 'fAliases' => '0', 'fMailboxes' => '0', - 'fMaxquota' => '0', 'fTransport' => 'virtual', - 'fDefaultaliases' => '0', 'fBackupmx' => '0') as $key => $default) { - if(isset($_POST[$key]) && !empty($POST[$key])) { + $form_fields = array('fDescription' => '', 'fAliases' => '0', 'fMailboxes' => '0', + 'fMaxquota' => '0', 'fTransport' => 'virtual', 'fDefaultaliases' => '0', + 'fBackupmx' => '0'); + foreach($form_fields as $key => $default) { + if(isset($_POST[$key]) && (!empty($_POST[$key]))) { $$key = escape_string($_POST[$key]); } else { @@ -63,6 +64,7 @@ } } + if (empty ($fDomain) or domain_exist ($fDomain) or !check_domain ($fDomain)) { $error = 1; @@ -77,7 +79,7 @@ if (domain_exist ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error']; if (empty ($fDomain) or !check_domain ($fDomain)) $pAdminCreate_domain_domain_text = $PALANG['pAdminCreate_domain_domain_text_error2']; } - + if ($error != 1) { $tAliases = $CONF['aliases']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-12-28 21:15:05
|
Revision: 273 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=273&view=rev Author: christian_boltz Date: 2007-12-28 13:15:04 -0800 (Fri, 28 Dec 2007) Log Message: ----------- create-domain.php: - make $fBackupmx pgsql-compatible (using db_get_boolean()) Thanks to Micheas Herman (micheas) https://sourceforge.net/tracker/?func=detail&atid=937966&aid=1858922&group_id=191583 - also use db_get_boolean() for $sqlBackupmx - that's better than checking for pgsql explicitely Modified Paths: -------------- trunk/create-domain.php Modified: trunk/create-domain.php =================================================================== --- trunk/create-domain.php 2007-12-17 07:03:54 UTC (rev 272) +++ trunk/create-domain.php 2007-12-28 21:15:04 UTC (rev 273) @@ -91,13 +91,13 @@ $fAliases = -1; $fMailboxes = -1; $fMaxquota = -1; - $fBackupmx = 1; - $sqlBackupmx = ('pgsql'==$CONF['database_type']) ? 'true' : 1; + $fBackupmx = db_get_boolean(true); + $sqlBackupmx = db_get_boolean(true); } else { - $fBackupmx = 0; - $sqlBackupmx = ('pgsql'==$CONF['database_type']) ? 'false' : 0; + $fBackupmx = db_get_boolean(false); + $sqlBackupmx = db_get_boolean(false); } $sql_query = "INSERT INTO $table_domain (domain,description,aliases,mailboxes,maxquota,transport,backupmx,created,modified) VALUES ('$fDomain','$fDescription',$fAliases,$fMailboxes,$fMaxquota,'$fTransport',$sqlBackupmx,NOW(),NOW())"; $result = db_query($sql_query); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-12-28 21:27:09
|
Revision: 274 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=274&view=rev Author: christian_boltz Date: 2007-12-28 13:27:11 -0800 (Fri, 28 Dec 2007) Log Message: ----------- create-domain.php: - partly undo last change (r273) - $fBackupmx is not used in the SQL query, but in the template file - keep usage of db_get_boolean() for $sqlBackupmx Modified Paths: -------------- trunk/create-domain.php Modified: trunk/create-domain.php =================================================================== --- trunk/create-domain.php 2007-12-28 21:15:04 UTC (rev 273) +++ trunk/create-domain.php 2007-12-28 21:27:11 UTC (rev 274) @@ -91,12 +91,12 @@ $fAliases = -1; $fMailboxes = -1; $fMaxquota = -1; - $fBackupmx = db_get_boolean(true); + $fBackupmx = 1; $sqlBackupmx = db_get_boolean(true); } else { - $fBackupmx = db_get_boolean(false); + $fBackupmx = 0; $sqlBackupmx = db_get_boolean(false); } $sql_query = "INSERT INTO $table_domain (domain,description,aliases,mailboxes,maxquota,transport,backupmx,created,modified) VALUES ('$fDomain','$fDescription',$fAliases,$fMailboxes,$fMaxquota,'$fTransport',$sqlBackupmx,NOW(),NOW())"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |