From 73e662dbe1b3d3d58d609dc014876da70b4542b8 Mon Sep 17 00:00:00 2001 From: Lai Wei Date: Wed, 20 Oct 2021 14:50:13 +0100 Subject: [PATCH] avoid warnings for first column of query results not unique --- classes/feature/usersync/main.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/classes/feature/usersync/main.php b/classes/feature/usersync/main.php index 1190c5c4a..7418622ba 100644 --- a/classes/feature/usersync/main.php +++ b/classes/feature/usersync/main.php @@ -895,13 +895,9 @@ public function sync_users(array $aadusers = array()) { return true; } + $select = 'SELECT LOWER(u.username) AS username,'; if (isset($aadsync['emailsync'])) { - $select = 'SELECT LOWER(u.email) AS email, - LOWER(u.username) AS username,'; - $where = ' WHERE u.email'; - } else { - $select = 'SELECT LOWER(u.username) AS username,'; - $where = ' WHERE u.username'; + $select .= ' LOWER(u.email) AS email,'; } list($usernamesql, $usernameparams) = $DB->get_in_or_equal($usernames);