diff --git a/public/profile.php b/public/profile.php index 68d7b83..d765a24 100644 --- a/public/profile.php +++ b/public/profile.php @@ -30,6 +30,17 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { } else { $error = 'Your old password is incorrect.'; } + } else if (isset($_POST['reset_recovery_code'])) { + if (pp_password_verify($_POST['old_password'], $user_password)) { + $user_new_code = pp_random_token(); + + $current_user->recovery_code_hash = pp_password_hash($user_new_code); + $current_user->save(); + + $success = 'Your recovery code has been updated - please see below.'; + } else { + $error = 'Your password is incorrect.'; + } } else { $error = 'All fields must be filled out.'; } diff --git a/theme/bulma/profile.php b/theme/bulma/profile.php index 873a7bf..110ba06 100644 --- a/theme/bulma/profile.php +++ b/theme/bulma/profile.php @@ -28,18 +28,15 @@
- +
- -
- Coming soon +