SF.net SVN: postfixadmin: [213] trunk
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2007-11-12 00:46:53
|
Revision: 213 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=213&view=rev Author: christian_boltz Date: 2007-11-11 16:46:52 -0800 (Sun, 11 Nov 2007) Log Message: ----------- 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 Modified Paths: -------------- trunk/templates/users_password.tpl trunk/users/password.php trunk/users/vacation.php Modified: trunk/templates/users_password.tpl =================================================================== --- trunk/templates/users_password.tpl 2007-11-12 00:14:16 UTC (rev 212) +++ trunk/templates/users_password.tpl 2007-11-12 00:46:52 UTC (rev 213) @@ -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> Modified: trunk/users/password.php =================================================================== --- trunk/users/password.php 2007-11-12 00:14:16 UTC (rev 212) +++ trunk/users/password.php 2007-11-12 00:46:52 UTC (rev 213) @@ -35,16 +35,13 @@ $tmp = preg_split ('/@/', $USERID_USERNAME); $USERID_DOMAIN = $tmp[1]; -if ($_SERVER['REQUEST_METHOD'] == "GET") +if ($_SERVER['REQUEST_METHOD'] == "POST") { - include ("../templates/header.tpl"); - include ("../templates/users_menu.tpl"); - include ("../templates/users_password.tpl"); - include ("../templates/footer.tpl"); -} + if(isset($_POST['fCancel'])) { + header("Location: main.php"); + exit(0); + } -if ($_SERVER['REQUEST_METHOD'] == "POST") -{ $fPassword_current = escape_string ($_POST['fPassword_current']); $fPassword = escape_string ($_POST['fPassword']); $fPassword2 = escape_string ($_POST['fPassword2']); @@ -82,18 +79,22 @@ $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: */ ?> Modified: trunk/users/vacation.php =================================================================== --- trunk/users/vacation.php 2007-11-12 00:14:16 UTC (rev 212) +++ trunk/users/vacation.php 2007-11-12 00:46:52 UTC (rev 213) @@ -58,13 +58,6 @@ 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 @@ } 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: */ ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |