Skip to content

Commit

Permalink
avoid warnings for first column of query results not unique
Browse files Browse the repository at this point in the history
  • Loading branch information
weilai-irl committed Oct 20, 2021
1 parent 7a704ab commit 73e662d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions classes/feature/usersync/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 73e662d

Please sign in to comment.