edit-mailbox.php:

- replace $tMessaeg with flash_error()
- use pEdit_mailbox_quota_text_error instead of pEdit_mailbox_quota_text
  for error message

templates/edit-mailbox.tpl:
- added 4th column for error messages
- replaced <h3> with <th>
- marked labels with <label>
- marked non-editable fields with <em>
- aligned buttons with input fields
- 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@1101 a1433add-5e2c-0410-b055-b7f2511e0802
pull/2/head
Christian Boltz 15 years ago
parent 54cec415ce
commit 5f4f20accf

@ -18,7 +18,6 @@
*
* Template Variables:
*
* tMessage
* tName
* tQuota
*
@ -48,7 +47,7 @@ if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
$pEdit_mailbox_name_text = $PALANG['pEdit_mailbox_name_text'];
$pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text'];
$pEdit_mailbox_quota_text_error = "";
if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin')) )
{
@ -56,7 +55,7 @@ if (!(check_owner ($SESSID_USERNAME, $fDomain) || authentication_has_role('globa
$tName = $fName;
$tQuota = $fQuota;
$tActive = $fActive;
$tMessage = $PALANG['pEdit_mailbox_domain_error'] . "$fDomain</span>";
flash_error($PALANG['pEdit_mailbox_domain_error'] . "$fDomain");
}
$result = db_query("SELECT * FROM $table_mailbox WHERE username = '$fUsername' AND domain = '$fDomain'");
@ -123,7 +122,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tName = $fName;
$tQuota = $fQuota;
$tActive = $fActive;
$pEdit_mailbox_quota_text = $PALANG['pEdit_mailbox_quota_text_error'];
$pEdit_mailbox_quota_text_error = $PALANG['pEdit_mailbox_quota_text_error'];
}
}
if ($error != 1)
@ -157,7 +156,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$result = db_update_q('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars); # TODO: check if we need the AND domain=... clause, if not, switch to db_update()
$maildir = $user_details['maildir'];
if ($result != 1 || !mailbox_postedit($fUsername,$fDomain,$maildir, $quota)) {
$tMessage = $PALANG['pEdit_mailbox_result_error'];
flash_error($PALANG['pEdit_mailbox_result_error']);
}
else {
db_log ($fDomain, 'edit_mailbox', $fUsername);
@ -182,8 +181,8 @@ $smarty->assign ('pEdit_mailbox_name_text', $pEdit_mailbox_name_text,false);
$smarty->assign ('tMaxquota', $tMaxquota);
$smarty->assign ('tQuota', $tQuota);
$smarty->assign ('pEdit_mailbox_quota_text', $pEdit_mailbox_quota_text);
$smarty->assign ('pEdit_mailbox_quota_text_error', $pEdit_mailbox_quota_text_error);
if ($tActive) $smarty->assign ('tActive', ' checked="checked"');
$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'edit-mailbox');
$smarty->display ('index.tpl');
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */

@ -3,48 +3,52 @@
<form name="mailbox" method="post" action="">
<table>
<tr>
<td colspan="3"><h3>{$PALANG.pEdit_mailbox_welcome}</h3></td>
<th colspan="4">{$PALANG.pEdit_mailbox_welcome}</th>
</tr>
<tr>
<td>{$PALANG.pEdit_mailbox_username}</td>
<td>{$fUsername}</td>
<td class="label"><label>{$PALANG.pEdit_mailbox_username}:</label></td>
<td><em>{$fUsername}</em></td>
<td>{$pEdit_mailbox_username_text}</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pEdit_mailbox_password}:</td>
<td class="label"><label>{$PALANG.pEdit_mailbox_password}:</label></td>
<td><input class="flat" type="password" name="fPassword" /></td>
<td>{$pEdit_mailbox_password_text}</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pEdit_mailbox_password2}:</td>
<td class="label"><label>{$PALANG.pEdit_mailbox_password2}:</label></td>
<td><input class="flat" type="password" name="fPassword2" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>{$PALANG.pEdit_mailbox_name}:</td>
<td class="label"><label>{$PALANG.pEdit_mailbox_name}:</label></td>
<td><input class="flat" type="text" name="fName" value="{$tName}" /></td>
<td>{$pEdit_mailbox_name_text}</td>
<td>&nbsp;</td>
</tr>
{if $CONF.quota===YES}
<tr>
<td>{$PALANG.pEdit_mailbox_quota} (max: {$tMaxquota}):</td>
<td class="label"><label>{$PALANG.pEdit_mailbox_quota} (max: {$tMaxquota}):</label></td>
<td><input class="flat" type="text" name="fQuota" value="{$tQuota}" /></td>
<td>{$pEdit_mailbox_quota_text}</td>
<td>{$pEdit_mailbox_quota_text_error}</td>
</tr>
{/if}
<tr>
<td>{$PALANG.pCreate_mailbox_active}:</td>
<td class="label"><label>{$PALANG.pCreate_mailbox_active}:</label></td>
<td><input class="flat" type="checkbox" name="fActive"{$tActive}/></td>
<td>&nbsp;</td>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="3" class="hlp_center">
<tr>
<td>&nbsp;</td>
<td>
<input class="button" type="submit" name="submit" value="{$PALANG.save}" />
<input class="button" type="submit" name="cancel" value="{$PALANG.exit}"/>
</td>
</tr>
<tr>
<td colspan="3" class="standout">{$tMessage}</td>
<td colspan="2">&nbsp;</td>
</tr>
</table>
</form>

Loading…
Cancel
Save