Skip to content

Commit

Permalink
[#108] Redirect user to unsuspend page after resetting password
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton committed Jan 11, 2024
1 parent 906779d commit b98a641
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

0 comments on commit b98a641

Please sign in to comment.