diff --git a/html/user/delete_account_confirm.php b/html/user/delete_account_confirm.php index 9dd31d83c4..4961092726 100644 --- a/html/user/delete_account_confirm.php +++ b/html/user/delete_account_confirm.php @@ -20,25 +20,56 @@ require_once("../inc/util.inc"); require_once("../inc/account.inc"); require_once("../inc/delete_account.inc"); require_once("../inc/token.inc"); +require_once("../inc/boinc_db.inc"); +require_once("../inc/user_util.inc"); -$userid = get_int("id"); -$token = get_str("token"); +function delete_account_confirm_form() { + //Make sure the token is still valid + $userid = get_int("id"); + $token = get_str("token"); + check_delete_account_token($userid, $token); + + page_head(tra("Delete Account")); + + echo "
".tra("Thank you for verifying ownership of your account.")."
" + ."".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."
" + ."".tra("As a reminder, your account cannot be recovered once you delete it.")."
" + ."".tra("Your account has been deleted. If you want to contribute to ".PROJECT." in the future you will need to create a new account.")."
"; + + page_tail(); +} -page_head(tra("Delete Account")); +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + delete_account_confirm_action(); +} else { + delete_account_confirm_form(); +} -echo "".tra("Thank you for verifying ownership of your account.")."
" - ."".tra("You can now delete your account by entering in your password below and clicking the \"Delete Account\" button.")."
" - ."".tra("As a reminder, your account cannot be recovered once you delete it.")."
" - ."".tra("Your account has been deleted. If you want to contribute to ".PROJECT." in the future you will need to create a new account.")."
"; - -page_tail(); -?> \ No newline at end of file diff --git a/html/user/delete_account_request.php b/html/user/delete_account_request.php index e1fbf6f2f2..276c358eb9 100644 --- a/html/user/delete_account_request.php +++ b/html/user/delete_account_request.php @@ -19,24 +19,45 @@ require_once("../inc/util.inc"); require_once("../inc/account.inc"); require_once("../inc/delete_account.inc"); +require_once("../inc/user_util.inc"); +require_once("../inc/email.inc"); $user = get_logged_in_user(); -page_head(tra("Delete Account")); +function delete_account_request_form($user) { + page_head(tra("Delete Account")); + + echo "".tra("You have the ability to delete your account. Please note that this cannot be undone once it is completed.")."
" + ."".tra("The process works as follows:")."
" + ."".tra("You have the ability to delete your account. Please note that this cannot be undone once it is completed.")."
" - ."".tra("The process works as follows:")."
" - ."".tra("The email to confirm your request to delete your account has been sent.")."
"; + page_tail(); +} -form_start(secure_url_base()."delete_account_request_action.php", "post"); -form_input_text(tra("Password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); -form_submit(tra("Send Confirmation Email")); -form_end(); +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + delete_account_request_action($user); +} else { + delete_account_request_form($user); +} -page_tail(); ?> \ No newline at end of file diff --git a/html/user/delete_account_request_action.php b/html/user/delete_account_request_action.php deleted file mode 100644 index 155d7450c4..0000000000 --- a/html/user/delete_account_request_action.php +++ /dev/null @@ -1,36 +0,0 @@ -. - -require_once("../inc/util.inc"); -require_once("../inc/account.inc"); -require_once("../inc/user_util.inc"); -require_once("../inc/email.inc"); -require_once("../inc/delete_account.inc"); - -//Verify password -$user = get_logged_in_user(); -$passwd = post_str("passwd"); - -check_passwd_ui($user, $passwd); - -send_confirm_delete_email($user); - -page_head(tra("Confirmation Email Sent")); -echo "".tra("The email to confirm your request to delete your account has been sent.")."
"; -page_tail(); -?> \ No newline at end of file