SF.net SVN: postfixadmin:[899] branches/postfixadmin-2.3
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2010-12-25 14:16:18
|
Revision: 899 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=899&view=rev Author: christian_boltz Date: 2010-12-25 14:16:11 +0000 (Sat, 25 Dec 2010) Log Message: ----------- edit-alias: some small fixes that came up while integrating the multiple alias target patch from anexius (r898): - replace spaces only at the start and end of a line, not in the middle of an (BTW: invalid) mail address - prevent input data loss on validation errors - allow multiple error messages (separated by <br /> (I'll port that to trunk also.) Modified Paths: -------------- branches/postfixadmin-2.3/edit-alias.php branches/postfixadmin-2.3/templates/edit-alias.php Modified: branches/postfixadmin-2.3/edit-alias.php =================================================================== --- branches/postfixadmin-2.3/edit-alias.php 2010-12-25 14:11:16 UTC (rev 898) +++ branches/postfixadmin-2.3/edit-alias.php 2010-12-25 14:16:11 UTC (rev 899) @@ -62,6 +62,7 @@ $tGoto = $row['goto']; $orig_alias_list = explode(',', $tGoto); + $tGoto = str_replace(',', "\n", $tGoto); $alias_list = $orig_alias_list; //. if we are not a global admin, and alias_control_admin is NO, hide the alias that's the mailbox name. if($CONF['alias_control_admin'] == 'NO' && !authentication_has_role('global-admin')) { @@ -101,7 +102,8 @@ $goto = preg_replace ('/\\\r\\\n/', ',', $fGoto); $goto = preg_replace ('/\r\n/', ',', $goto); - $goto = preg_replace ('/[\s]+/i', '', $goto); + $goto = preg_replace ('/,[\s]+/i', ',', $goto); + $goto = preg_replace ('/[\s]+,/i', ',', $goto); $goto = preg_replace ('/,*$|^,*/', '', $goto); $goto = preg_replace ('/,,*/', ',', $goto); @@ -126,7 +128,8 @@ { $error = 1; $tGoto = $goto; - $tMessage = $PALANG['pEdit_alias_goto_text_error2'] . "$address</span>"; + if (!empty($tMessage)) $tMessage .= "<br />"; + $tMessage .= $PALANG['pEdit_alias_goto_text_error2'] . "$address</span>"; } } @@ -159,6 +162,8 @@ header ("Location: list-virtual.php?domain=$fDomain"); exit; } + } else { # on error + $tGoto = htmlentities($_POST['fGoto']); } } Modified: branches/postfixadmin-2.3/templates/edit-alias.php =================================================================== --- branches/postfixadmin-2.3/templates/edit-alias.php 2010-12-25 14:11:16 UTC (rev 898) +++ branches/postfixadmin-2.3/templates/edit-alias.php 2010-12-25 14:16:11 UTC (rev 899) @@ -15,12 +15,7 @@ <td><?php print $PALANG['pEdit_alias_goto'] . ":"; ?></td> <td> <textarea class="flat" rows="10" cols="60" name="fGoto"> -<?php - -foreach($alias_list as $alias) { - print "$alias\n"; -} -?> +<?php print $tGoto; ?> </textarea> </td> <td> </td> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |