edit-admin.php:

- use additional column for error messages
- renamed $pAdminEdit_admin_password_text to $pAdminEdit_admin_password_text_error
- removed $tMessage

variables.inc.php:
- remove now unused $pAdminEdit_admin_password_text
  (this change was not contained in Dale's patch)

templates/admin_edit-admin.tpl
- added a 4th column for error messages
- HTML cleanup
- changed <h3> to <th>
- marked labels as <label>
- 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@1098 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 14 years ago
parent 484e7a74f0
commit 1786099b17

@ -38,6 +38,8 @@ require_once('common.php');
authentication_require_role('global-admin'); authentication_require_role('global-admin');
$error = 1; $error = 1;
$pAdminEdit_admin_password_text_error = "";
if(isset($_GET['username'])) { if(isset($_GET['username'])) {
$username = escape_string ($_GET['username']); $username = escape_string ($_GET['username']);
$result = db_query("SELECT * FROM $table_admin WHERE username = '$username'"); $result = db_query("SELECT * FROM $table_admin WHERE username = '$username'");
@ -81,12 +83,12 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
} }
else { else {
$error = 1; $error = 1;
flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); $pAdminEdit_admin_password_text_error = sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length']);
} }
} }
else { else {
$error = 1; $error = 1;
$pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; $pAdminEdit_admin_password_text_error = $PALANG['pAdminEdit_admin_password_text_error'];
} }
} }
} }
@ -151,11 +153,10 @@ if ($result['rows'] >= 1) {
} }
$smarty->assign ('username', $username); $smarty->assign ('username', $username);
$smarty->assign ('pAdminEdit_admin_password_text', $pAdminEdit_admin_password_text, false); $smarty->assign ('pAdminEdit_admin_password_text_error', $pAdminEdit_admin_password_text_error, false);
$smarty->assign ('tActive_checked', $tActive_checked); $smarty->assign ('tActive_checked', $tActive_checked);
$smarty->assign ('tSadmin_checked', $tSadmin_checked); $smarty->assign ('tSadmin_checked', $tSadmin_checked);
$smarty->assign ('select_options', select_options ($tAllDomains, $tDomains), false); $smarty->assign ('select_options', select_options ($tAllDomains, $tDomains), false);
$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'admin_edit-admin'); $smarty->assign ('smarty_template', 'admin_edit-admin');
$smarty->display ('index.tpl'); $smarty->display ('index.tpl');

@ -2,44 +2,43 @@
<form name="alias" method="post" action=""> <form name="alias" method="post" action="">
<table> <table>
<tr> <tr>
<td colspan="3"><h3>{$PALANG.pAdminEdit_admin_welcome}</h3></td></tr> <th colspan="4">{$PALANG.pAdminEdit_admin_welcome}</th>
</tr>
<tr> <tr>
<td>{$PALANG.pAdminEdit_admin_username}:</td> <td class="label"><label>{$PALANG.pAdminEdit_admin_username}:</label></td>
<td>{$username}</td> <td>{$username}</td>
<td>&nbsp;</td> <td colspan="2">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td>{$PALANG.pAdminEdit_admin_password}:</td> <td class="label"><label>{$PALANG.pAdminEdit_admin_password}:</label></td>
<td><input class="flat" type="password" name="fPassword" value=""/></td> <td><input class="flat" type="password" name="fPassword" value=""/></td>
<td>{$pAdminEdit_admin_password_text}</td> <td>&nbsp;</td>
<td><span class="error_msg">{$pAdminEdit_admin_password_text_error}</span></td>
</tr> </tr>
<tr> <tr>
<td>{$PALANG.pAdminEdit_admin_password2}:</td> <td class="label"><label>{$PALANG.pAdminEdit_admin_password2}:</label></td>
<td><input class="flat" type="password" name="fPassword2" value="" /></td> <td><input class="flat" type="password" name="fPassword2" value="" /></td>
<td>&nbsp;</td> <td colspan="2">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td>{$PALANG.pAdminEdit_admin_active}:</td> <td class="label"><label>{$PALANG.pAdminEdit_admin_active}:</label></td>
<td><input class="flat" type="checkbox" name="fActive"{$tActive_checked}/></td> <td><input class="flat" type="checkbox" name="fActive"{$tActive_checked}/></td>
<td>&nbsp;</td> <td colspan="2">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td>{$PALANG.pAdminEdit_admin_super_admin}:</td> <td class="label"><label>{$PALANG.pAdminEdit_admin_super_admin}:</label></td>
<td><input class="flat" type="checkbox" name="fSadmin"{$tSadmin_checked}/></td> <td><input class="flat" type="checkbox" name="fSadmin"{$tSadmin_checked}/></td>
<td>&nbsp;</td> <td colspan="2">&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td>{$PALANG.pAdminCreate_admin_address}:</td> <td class="label"><label>{$PALANG.pAdminCreate_admin_address}:</label></td>
<td> <td><select name="fDomains[]" size="10" multiple="multiple">{$select_options}</select></td>
<select name="fDomains[]" size="10" multiple="multiple">{$select_options}</select>
<td>&nbsp;</td> <td>&nbsp;</td>
</td>
</tr>
<tr>
<td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="{$PALANG.save}" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="3" class="standout">{$tMessage}</td> <td>&nbsp;</td>
<td><input class="button" type="submit" name="submit" value="{$PALANG.save}" /></td>
<td colspan="2">&nbsp;</td>
</tr> </tr>
</table> </table>
</form> </form>

@ -81,7 +81,6 @@ $pAdminCreate_admin_password_text = "&nbsp;";
$pAdminCreate_admin_username_text = "&nbsp;"; $pAdminCreate_admin_username_text = "&nbsp;";
$pAdminCreate_domain_defaultaliases_text = "&nbsp;"; $pAdminCreate_domain_defaultaliases_text = "&nbsp;";
$pAdminCreate_domain_domain_text = "&nbsp;"; $pAdminCreate_domain_domain_text = "&nbsp;";
$pAdminEdit_admin_password_text = "&nbsp;";
$pCreate_alias_address_text = "&nbsp;"; $pCreate_alias_address_text = "&nbsp;";
$pCreate_alias_goto_text = "&nbsp;"; $pCreate_alias_goto_text = "&nbsp;";
$pCreate_mailbox_name_text = "&nbsp;"; $pCreate_mailbox_name_text = "&nbsp;";

Loading…
Cancel
Save