You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-12-08 13:28:29 +03:00
create-alias.php:
- renamed $pCreate_alias_address_text to $pCreate_alias_address_text_error
- replaced $tMessage with flash_error() / flash_info()
- changes compared to Dale's patch:
- do not add $fAddress and $fGoto to $PALANG['pCreate_alias_goto_text_error']
error message
templates/create-alias.tpl:
- added 4th column for error messages
- replace <h3> with <th>
- mark labels with <label>
- aligned button with input fields
- added $PALANG[pCreate_alias_help]
- removed tMessage
This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1104 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@@ -19,7 +19,6 @@
|
|||||||
*
|
*
|
||||||
* Template Variables:
|
* Template Variables:
|
||||||
*
|
*
|
||||||
* tMessage
|
|
||||||
* tAddress
|
* tAddress
|
||||||
* tGoto
|
* tGoto
|
||||||
* tDomain
|
* tDomain
|
||||||
@@ -45,6 +44,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text'];
|
$pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text'];
|
||||||
|
$pCreate_alias_address_text_error = "";
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] == "GET")
|
if ($_SERVER['REQUEST_METHOD'] == "GET")
|
||||||
{
|
{
|
||||||
@@ -87,7 +87,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$tAddress = escape_string ($_POST['fAddress']);
|
$tAddress = escape_string ($_POST['fAddress']);
|
||||||
$tGoto = $fGoto;
|
$tGoto = $fGoto;
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1'];
|
$pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error1'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_alias($fDomain)) {
|
if(!check_alias($fDomain)) {
|
||||||
@@ -95,7 +95,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$tAddress = escape_string ($_POST['fAddress']);
|
$tAddress = escape_string ($_POST['fAddress']);
|
||||||
$tGoto = $fGoto;
|
$tGoto = $fGoto;
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error3'];
|
$pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error3'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty ($fAddress) || !check_email ($fAddress)) {
|
if(empty ($fAddress) || !check_email ($fAddress)) {
|
||||||
@@ -103,7 +103,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$tAddress = escape_string ($_POST['fAddress']);
|
$tAddress = escape_string ($_POST['fAddress']);
|
||||||
$tGoto = $fGoto;
|
$tGoto = $fGoto;
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error1'];
|
$pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error1'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Begin check alias email
|
// Begin check alias email
|
||||||
@@ -117,7 +117,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
if (empty ($goto) && !authentication_has_role('global-admin')) {
|
if (empty ($goto) && !authentication_has_role('global-admin')) {
|
||||||
$error = 1;
|
$error = 1;
|
||||||
$tGoto = $_POST['fGoto'];
|
$tGoto = $_POST['fGoto'];
|
||||||
$tMessage = $PALANG['pEdit_alias_goto_text_error1'];
|
flash_error($PALANG['pEdit_alias_goto_text_error1']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_aliases = array();
|
$new_aliases = array();
|
||||||
@@ -132,8 +132,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
if (!check_email($address)) {
|
if (!check_email($address)) {
|
||||||
$error = 1;
|
$error = 1;
|
||||||
$tGoto = $goto;
|
$tGoto = $goto;
|
||||||
if (!empty($tMessage)) $tMessage .= "<br />";
|
flash_error($PALANG['pEdit_alias_goto_text_error2'] . "$address");
|
||||||
$tMessage .= $PALANG['pEdit_alias_goto_text_error2'] . "$address</span>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +145,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$tAddress = escape_string ($_POST['fAddress']);
|
$tAddress = escape_string ($_POST['fAddress']);
|
||||||
$tGoto = $fGoto;
|
$tGoto = $fGoto;
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$pCreate_alias_goto_text = $PALANG['pCreate_alias_goto_text_error'];
|
flash_error($PALANG['pCreate_alias_goto_text_error']");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (escape_string($_POST['fAddress']) == "*") {
|
if (escape_string($_POST['fAddress']) == "*") {
|
||||||
@@ -160,7 +159,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$tAddress = escape_string ($_POST['fAddress']);
|
$tAddress = escape_string ($_POST['fAddress']);
|
||||||
$tGoto = $fGoto;
|
$tGoto = $fGoto;
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2'];
|
$pCreate_alias_address_text_error = $PALANG['pCreate_alias_address_text_error2'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($fActive == "on") {
|
if ($fActive == "on") {
|
||||||
@@ -178,13 +177,13 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')");
|
$result = db_query ("INSERT INTO $table_alias (address,goto,domain,created,modified,active) VALUES ('$fAddress','$fGoto','$fDomain',NOW(),NOW(),'$sqlActive')");
|
||||||
if ($result['rows'] != 1) {
|
if ($result['rows'] != 1) {
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$tMessage = $PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n";
|
flash_error($PALANG['pCreate_alias_result_error'] . "<br />($fAddress -> $fGoto)<br />\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
db_log ($fDomain, 'create_alias', "$fAddress -> $fGoto");
|
db_log ($fDomain, 'create_alias', "$fAddress -> $fGoto");
|
||||||
|
|
||||||
$tDomain = $fDomain;
|
$tDomain = $fDomain;
|
||||||
$tMessage = $PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n";
|
flash_info($PALANG['pCreate_alias_result_success'] . "<br />($fAddress -> $fGoto)<br />\n");
|
||||||
}
|
}
|
||||||
} else { # on error
|
} else { # on error
|
||||||
$tAddress = htmlentities($_POST['fAddress']);
|
$tAddress = htmlentities($_POST['fAddress']);
|
||||||
@@ -196,9 +195,9 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
|
|||||||
$smarty->assign ('tAddress', $tAddress);
|
$smarty->assign ('tAddress', $tAddress);
|
||||||
$smarty->assign ('select_options', select_options ($list_domains, array ($tDomain)), false);
|
$smarty->assign ('select_options', select_options ($list_domains, array ($tDomain)), false);
|
||||||
$smarty->assign ('pCreate_alias_address_text', $pCreate_alias_address_text, false);
|
$smarty->assign ('pCreate_alias_address_text', $pCreate_alias_address_text, false);
|
||||||
|
$smarty->assign ('pCreate_alias_address_text_error', $pCreate_alias_address_text_error, false);
|
||||||
$smarty->assign ('tGoto', $tGoto, false);
|
$smarty->assign ('tGoto', $tGoto, false);
|
||||||
$smarty->assign ('pCreate_alias_goto_text', $pCreate_alias_goto_text);
|
$smarty->assign ('pCreate_alias_goto_text', $pCreate_alias_goto_text);
|
||||||
$smarty->assign ('tMessage', $tMessage, false);
|
|
||||||
$smarty->assign ('smarty_template', 'create-alias');
|
$smarty->assign ('smarty_template', 'create-alias');
|
||||||
$smarty->display ('index.tpl');
|
$smarty->display ('index.tpl');
|
||||||
|
|
||||||
|
|||||||
@@ -3,33 +3,32 @@
|
|||||||
<form name="alias" method="post" action="">
|
<form name="alias" method="post" action="">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"><h3>{$PALANG.pCreate_alias_welcome}</h3></td>
|
<th colspan="4">{$PALANG.pCreate_alias_welcome}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$PALANG.pCreate_alias_address}</td>
|
<td class="label"><label>{$PALANG.pCreate_alias_address}:</label></td>
|
||||||
<td><input class="flat" type="text" name="fAddress" value="{$tAddress}" /></td>
|
<td colspan="2"><input class="flat" type="text" name="fAddress" value="{$tAddress}" />
|
||||||
<td>@
|
@
|
||||||
<select class="flat" name="fDomain">{$select_options}</select>
|
<select class="flat" name="fDomain">{$select_options}</select>
|
||||||
{$pCreate_alias_address_text}
|
{$pCreate_alias_address_text}
|
||||||
</td>
|
</td>
|
||||||
|
<td><span class="error_msg">{$pCreate_alias_address_text_error}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$PALANG.pCreate_alias_goto}:</td>
|
<td class="label"><label>{$PALANG.pCreate_alias_goto}:</label></td>
|
||||||
<td colspan="2"><textarea class="flat" rows="10" cols="60" name="fGoto">{$tGoto}</textarea></td>
|
<td><textarea class="flat" rows="10" cols="35" name="fGoto">{$tGoto}</textarea></td>
|
||||||
</tr>
|
<td>{$PALANG.pCreate_alias_help}<br /><br />{$PALANG.pCreate_alias_catchall_text}</td>
|
||||||
<tr>
|
|
||||||
<td>{$PALANG.pCreate_alias_active}:</td>
|
|
||||||
<td><input class="flat" type="checkbox" name="fActive" checked="checked"/></td>
|
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="{$PALANG.pCreate_alias_button}" /></td>
|
<td class="label"><label>{$PALANG.pCreate_alias_active}:</label></td>
|
||||||
|
<td><input class="flat" type="checkbox" name="fActive" checked="checked"/></td>
|
||||||
|
<td colspan="2"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" class="standout">{$tMessage}</td>
|
<td> </td>
|
||||||
</tr>
|
<td><input class="button" type="submit" name="submit" value="{$PALANG.pCreate_alias_button}" /></td>
|
||||||
<tr>
|
<td colspan="2"> </td>
|
||||||
<td colspan="3" class="help_text">{$PALANG.pCreate_alias_catchall_text}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user