From b98a6415e9137a55eea9d4264e53de1b8b611aba Mon Sep 17 00:00:00 2001 From: Matthew Hilton Date: Thu, 11 Jan 2024 15:24:08 +1000 Subject: [PATCH] [#108] Redirect user to unsuspend page after resetting password --- lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib.php b/lib.php index 4266820..aa0492a 100644 --- a/lib.php +++ b/lib.php @@ -70,6 +70,13 @@ function auth_enrolkey_post_set_password_requests($data) { return; } + // Log them out immediately. + // Required since resetting password logs you in, + // but the user is still suspended, so they get stuck in a halfway state. require_logout(); + + // Redirect them to the unsuspend page afterwards. + // So they can enter their new details and enrolkey and unsuspend themselves. + redirect(new moodle_url('/auth/enrolkey/unsuspend.php')); }