SF.net SVN: postfixadmin:[603] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <Gin...@us...> - 2009-03-25 15:26:33
|
Revision: 603 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=603&view=rev Author: GingerDog Date: 2009-03-25 15:26:23 +0000 (Wed, 25 Mar 2009) Log Message: ----------- fix errors e.g. see https://sourceforge.net/tracker/?func=detail&aid=2711888&group_id=191583&atid=937964 Modified Paths: -------------- trunk/model/AliasHandler.php trunk/model/UserHandler.php trunk/users/edit-alias.php Modified: trunk/model/AliasHandler.php =================================================================== --- trunk/model/AliasHandler.php 2009-03-25 14:51:12 UTC (rev 602) +++ trunk/model/AliasHandler.php 2009-03-25 15:26:23 UTC (rev 603) @@ -25,8 +25,7 @@ $sql = "SELECT * FROM $table_alias WHERE address='$username'"; $result = db_query($sql); - if ($result['rows'] == 1) - { + if($result['rows'] == 1) { $row = db_array ($result['result']); // At the moment Postfixadmin stores aliases in it's database in a comma seperated list; this may change one day. $list = explode(',', $row['goto']); Modified: trunk/model/UserHandler.php =================================================================== --- trunk/model/UserHandler.php 2009-03-25 14:51:12 UTC (rev 602) +++ trunk/model/UserHandler.php 2009-03-25 15:26:23 UTC (rev 603) @@ -57,9 +57,9 @@ if ($result['rows'] == 1) { $row = db_array ($result['result']); - $password = pacrypt ($password, $row['password']); + $crypt_password = pacrypt ($password, $row['password']); - if($row['password'] == $password) { + if($row['password'] == $crypt_password) { return true; } } Modified: trunk/users/edit-alias.php =================================================================== --- trunk/users/edit-alias.php 2009-03-25 14:51:12 UTC (rev 602) +++ trunk/users/edit-alias.php 2009-03-25 15:26:23 UTC (rev 603) @@ -41,14 +41,12 @@ $vacation_goto = preg_replace('/@/', '#', $USERID_USERNAME) . '@' . $vacation_domain; $ah = new AliasHandler($USERID_USERNAME); +$tGotoArray = $ah->get(); +$tStoreAndForward = $ah->hasStoreAndForward(); +$vacation_domain = $CONF['vacation_domain']; if ($_SERVER['REQUEST_METHOD'] == "GET") { - $vacation_domain = $CONF['vacation_domain']; - - $tGotoArray = $ah->get(); - $tStoreAndForward = $ah->hasStoreAndForward(); - include ("../templates/header.php"); include ("../templates/users_menu.php"); include ("../templates/users_edit-alias.php"); @@ -66,8 +64,9 @@ $pEdit_alias_goto = $PALANG['pEdit_alias_goto']; if (isset($_POST['fVacation'])) $fVacation = $_POST['fVacation']; - if (isset($_POST['fGoto'])) $fGoto = escape_string (trim($_POST['fGoto'])); - if (isset($_POST['fForward_and_store'])) $fForward_and_store = escape_string ($_POST['fForward_and_store']); + if (isset($_POST['fGoto'])) $fGoto = trim($_POST['fGoto']); + if (isset($_POST['fForward_and_store'])) $fForward_and_store = $_POST['fForward_and_store']; + $goto = strtolower ($fGoto); $goto = preg_replace ('/\\\r\\\n/', ',', $goto); $goto = preg_replace ('/\r\n/', ',', $goto); @@ -77,18 +76,23 @@ $goto = explode(",",$goto); $goto = array_merge(array_unique($goto)); - $good_goto = array(); - foreach($goto as $address) { - if(!check_email($address)) { - $error += 1; - $tMessage = $PALANG['pEdit_alias_goto_text_error1'] . "$address</font>"; + if($fForward_and_store == 'NO' && sizeof($goto) == 1 && $goto[0] == '') { + $tMessage = $PALANG['pEdit_alias_goto_text_error1']; + $error += 1; + } + if($error === 0) { + foreach($goto as $address) { + if(!check_email($address)) { + $error += 1; + $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . " $address</font>"; + } + else { + $good_goto[] = $address; + } } - else { - $good_goto[] = $address; - } + $goto = $good_goto; } - $goto = $good_goto; if ($error == 0) { $flags = 'remote_only'; @@ -102,7 +106,9 @@ } $tMessage = $PALANG['pEdit_alias_result_error']; } - + else { + $tGotoArray = $goto; + } include ("../templates/header.php"); include ("../templates/users_menu.php"); include ("../templates/users_edit-alias.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |