From b622136fd78ade6ff063a2cc00c85c1a8f1496c1 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 23 Dec 2014 10:47:18 -0800 Subject: [PATCH] web: clean up "change password" pages For some reason these pages had their own login logic. Remove this; you must be logged in first. --- html/user/edit_passwd_action.php | 36 +++++++++----------------------- html/user/edit_passwd_form.php | 27 +++--------------------- 2 files changed, 13 insertions(+), 50 deletions(-) diff --git a/html/user/edit_passwd_action.php b/html/user/edit_passwd_action.php index 79a24a411e..f6ad3fa176 100644 --- a/html/user/edit_passwd_action.php +++ b/html/user/edit_passwd_action.php @@ -1,7 +1,7 @@ passwd_hash != $passwd_hash) { - error_page(tra("Invalid password")); - } + +$passwd_hash = md5($passwd.$user->email_addr); +$result = $user->update("passwd_hash='$passwd_hash'"); +if (!$result) { + error_page(tra("We can't update your password due to a database problem. Please try again later.")); } page_head(tra("Change password")); -$passwd_hash = md5($passwd.$user->email_addr); -$result = $user->update("passwd_hash='$passwd_hash'"); -if ($result) { - echo tra("Your password has been changed."); -} else { - echo tra("We can't update your password due to a database problem. Please try again later."); -} - +echo tra("Your password has been changed."); page_tail(); + ?> diff --git a/html/user/edit_passwd_form.php b/html/user/edit_passwd_form.php index 60f576114a..795b356582 100644 --- a/html/user/edit_passwd_form.php +++ b/html/user/edit_passwd_form.php @@ -1,7 +1,7 @@ "; - -if ($user) { - echo " - authenticator> - "; - start_table(); -} else { - start_table(); - row1(tra("You can identify yourself using either"). - "" - ); - row2(tra("Email address"), ""); - row2(tra("Current password"), ""); - row2( - tra("OR: Account key"). - "
".tra("Get account key by email")."", - "" - ); -} +start_table(); row2(tra("New password"), ""); row2(tra("New password, again"), ""); row2("", "");