0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-20 03:36:20 +02:00

users/edit-alias.php, users/password.php, users/vacation.php, users/login.php:

- replaced tMessage with flash_error() / flash_info()

users/vacation.php:
- set today as default date if vacation start/end date are empty

users/edit-alias.php:
- removed now superfluous code to join multiple tMessage texts with <br>
- removed a </font> that was appended to $PALANG['pEdit_alias_goto_text_error2']

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@1085 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz 2011-07-18 22:36:38 +00:00
parent 59dd7cb083
commit ceb24297c7
4 changed files with 14 additions and 19 deletions

View File

@ -19,7 +19,6 @@
*
* Template Variables:
*
* tMessage
* tGotoArray
* tStoreAndForward
*
@ -85,7 +84,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$good_goto = array();
if($fForward_and_store != 'YES' && sizeof($goto) == 1 && $goto[0] == '') {
$tMessage = $PALANG['pEdit_alias_goto_text_error1'];
flash_error($PALANG['pEdit_alias_goto_text_error1']);
$error += 1;
}
if($error === 0) {
@ -98,8 +97,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
# (avoid empty elements in $goto) in trunk ;-)
if(!check_email($address)) {
$error += 1;
if (!empty($tMessage)) $tMessage .= "<br />";
$tMessage .= $PALANG['pEdit_alias_goto_text_error2'] . " $address</font>";
flash_error($PALANG['pEdit_alias_goto_text_error2'] . " $address");
}
else {
$good_goto[] = $address;
@ -118,13 +116,11 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
header ("Location: main.php");
exit;
}
if (!empty($tMessage)) $tMessage .= "<br />";
$tMessage .= $PALANG['pEdit_alias_result_error'];
flash_error($PALANG['pEdit_alias_result_error']);
}
else {
$tGotoArray = $goto;
}
$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('tGotoArray', $tGotoArray);
if ($fForward_and_store == "YES") {
$smarty->assign ('forward_and_store', ' checked="checked"');

View File

@ -18,7 +18,6 @@
*
* Template Variables:
*
* tMessage
* tUsername
*
* Form POST \ GET Variables:
@ -62,11 +61,10 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
}
else {
$error = 1;
$tMessage = '<span class="error_msg">' . $PALANG['pLogin_failed'] . '</span>';
flash_error($PALANG['pLogin_failed']);;
$tUsername = $fUsername;
}
$smarty->assign ('tUsername', $tUsername);
$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'users_login');
$smarty->display ('index.tpl');
}

View File

@ -18,7 +18,7 @@
*
* Template Variables:
*
* tMessage
* none
*
* Form POST \ GET Variables:
*
@ -71,7 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
}
else
{
$tMessage = $PALANG['pPassword_result_error'];
flash_error($PALANG['pPassword_result_error']);
}
}
}
@ -79,7 +79,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$smarty->assign ('USERID_USERNAME', $username);
$smarty->assign ('pPassword_password_current_text', $pPassword_password_current_text, false);
$smarty->assign ('pPassword_password_text', $pPassword_password_text, false);
$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('smarty_template', 'users_password');
$smarty->display ('index.tpl');

View File

@ -19,7 +19,6 @@
*
* Template Variables:
*
* tMessage
* tSubject
* tBody
*
@ -61,7 +60,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
$fActiveUntil = $details['activeUntil'];
}
if($vh->check_vacation()) {
$tMessage = $PALANG['pUsersVacation_welcome_text'];
flash_info($PALANG['pUsersVacation_welcome_text']);
}
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
@ -93,7 +92,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if(!$vh->set_away($fSubject, $fBody, $tActiveFrom, $tActiveUntil)) {
$error = 1;
$tMessage = $PALANG['pUsersVacation_result_error'];
flash_error($PALANG['pUsersVacation_result_error']);
}
flash_info($PALANG['pVacation_result_added']);
header ("Location: main.php");
@ -102,16 +101,19 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
if (!empty ($fBack)) {
$vh->remove();
$tMessage = $PALANG['pUsersVacation_result_success'];
flash_info($tMessage);
flash_info($PALANG['pUsersVacation_result_success']);
header ("Location: main.php");
exit;
}
}
if (empty ($fActiveFrom))
$fActiveFrom = date ("Y-m-d");
if (empty ($fActiveUntil))
$fActiveUntil = date ("Y-m-d");
$smarty->assign ('tSubject', htmlentities ($tSubject, ENT_QUOTES, 'UTF-8'), false);
$smarty->assign ('tBody', htmlentities ($tBody, ENT_QUOTES, 'UTF-8'), false);
$smarty->assign ('tMessage', $tMessage, false);
$smarty->assign ('tActiveFrom', date ("d.m.Y", strtotime ($fActiveFrom)));
$smarty->assign ('tActiveUntil', date ("d.m.Y", strtotime ($fActiveUntil)));
$smarty->assign ('smarty_template', 'users_vacation');