diff --git a/templates/users_password.tpl b/templates/users_password.tpl index ea52d038..100682fe 100644 --- a/templates/users_password.tpl +++ b/templates/users_password.tpl @@ -27,7 +27,7 @@ - + diff --git a/users/password.php b/users/password.php index e0d66b88..69276b17 100644 --- a/users/password.php +++ b/users/password.php @@ -35,16 +35,13 @@ $USERID_USERNAME = authentication_get_username(); $tmp = preg_split ('/@/', $USERID_USERNAME); $USERID_DOMAIN = $tmp[1]; -if ($_SERVER['REQUEST_METHOD'] == "GET") -{ - include ("../templates/header.tpl"); - include ("../templates/users_menu.tpl"); - include ("../templates/users_password.tpl"); - include ("../templates/footer.tpl"); -} - if ($_SERVER['REQUEST_METHOD'] == "POST") { + if(isset($_POST['fCancel'])) { + header("Location: main.php"); + exit(0); + } + $fPassword_current = escape_string ($_POST['fPassword_current']); $fPassword = escape_string ($_POST['fPassword']); $fPassword2 = escape_string ($_POST['fPassword2']); @@ -82,18 +79,22 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $result = db_query ("UPDATE $table_mailbox SET password='$password',modified=NOW() WHERE username='$username'"); if ($result['rows'] == 1) { - $tMessage = $PALANG['pPassword_result_success']; + flash_info($PALANG['pPassword_result_success']); db_log ($USERID_USERNAME, $USERID_DOMAIN, 'edit_password', "$USERID_USERNAME"); + header("Location: main.php"); + exit(0); } else { $tMessage = $PALANG['pPassword_result_error']; } } - - include ("../templates/header.tpl"); - include ("../templates/users_menu.tpl"); - include ("../templates/users_password.tpl"); - include ("../templates/footer.tpl"); } + +include ("../templates/header.tpl"); +include ("../templates/users_menu.tpl"); +include ("../templates/users_password.tpl"); +include ("../templates/footer.tpl"); + +/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?> diff --git a/users/vacation.php b/users/vacation.php index f604870a..2ef2cb39 100644 --- a/users/vacation.php +++ b/users/vacation.php @@ -58,13 +58,6 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } - - $template = "users_vacation.tpl"; - - include ("../templates/header.tpl"); - include ("../templates/users_menu.tpl"); - include ("../templates/users_vacation.tpl"); - include ("../templates/footer.tpl"); } if ($_SERVER['REQUEST_METHOD'] == "POST") @@ -174,16 +167,25 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") } else { + flash_info($PALANG['pVacation_result_added']); header ("Location: main.php"); exit; } } - include ("../templates/header.tpl"); - include ("../templates/users_menu.tpl"); - include ("../templates/users_vacation.tpl"); - include ("../templates/footer.tpl"); + if (!empty ($fBack)) { + if ($tMessage == '' || $tMessage = $PALANG['pUsersVacation_result_success']) { + flash_info($PALANG['pVacation_result_removed']); + header ("Location: main.php"); + exit; + } + } } +include ("../templates/header.tpl"); +include ("../templates/users_menu.tpl"); +include ("../templates/users_vacation.tpl"); +include ("../templates/footer.tpl"); + /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?>