From d14d016f776b28481c04f37d44d0eac86fda14b5 Mon Sep 17 00:00:00 2001 From: Peter Burnett Date: Wed, 7 Sep 2022 12:25:28 +1000 Subject: [PATCH] Fix incorrect assumption about username based on email --- classes/utility.php | 5 ----- unsuspend.php | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/classes/utility.php b/classes/utility.php index decb569..1ed492d 100644 --- a/classes/utility.php +++ b/classes/utility.php @@ -59,11 +59,6 @@ public static function search_for_suspended_user($data) { $params['username'] = $data['username']; } - // This setting means the email address is the username. - if ($CFG->createuserwithemail) { - $params['username'] = $data['email']; - } - return $DB->get_record('user', $params, '*'); } diff --git a/unsuspend.php b/unsuspend.php index 2884a75..7bbbc63 100644 --- a/unsuspend.php +++ b/unsuspend.php @@ -41,6 +41,7 @@ $PAGE->set_pagelayout('login'); $PAGE->set_title(get_string('title_unsuspend', 'auth_enrolkey')); $PAGE->set_heading(get_string('heading_unsuspend', 'auth_enrolkey')); +$PAGE->set_context($context); $output = $PAGE->get_renderer('auth_enrolkey'); $form = new unsuspend_form($baseurl);