users/password.php

- merged GET and POST code
- make cancel button working
- redirect to main page on success
- displaying success note with flash_info()

templates/users_password.tpl:
- rename cancel button to fCancel to make it work

users/vacation.php
- redirect to main page on success
- displaying success note with flash_info()
- merge GET and POST code


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@213 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
Christian Boltz 17 years ago
parent 36ab16cf8e
commit 29b143bee9

@ -27,7 +27,7 @@
<tr>
<td colspan="3" class="hlp_center">
<input class="button" type="submit" name="submit" value="<?php print $PALANG['pPassword_button']; ?>" />
<input class="button" type="submit" name="submit" value="<?php print $PALANG['exit']; ?>" action="main.php" >
<input class="button" type="submit" name="fCancel" value="<?php print $PALANG['exit']; ?>" />
</td>
</tr>
<tr>

@ -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: */
?>

@ -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: */
?>

Loading…
Cancel
Save