Commit f5e50bf3 authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Gerrit Code Review
Browse files

Merge "Fix user_exists methods in auth plugins (bug #761549)"

parents d964b5e3 24434a62
......@@ -213,7 +213,7 @@ abstract class Auth {
*/
public function user_exists($username) {
$this->must_be_ready();
if (record_exists('usr', 'LOWER(username)', strtolower($username))) {
if (record_exists_select('usr', 'LOWER(username) = ?', array(strtolower($username)))) {
return true;
}
throw new AuthUnknownUserException("\"$username\" is not known to Auth");
......
......@@ -400,12 +400,12 @@ class AuthXmlrpc extends Auth {
// The user is likely to be associated with the parent instance
if (is_numeric($this->config['parent']) && $this->config['parent'] > 0) {
$_instanceid = $this->config['parent'];
$userrecord = get_record('usr', 'LOWER(username)', strtolower($username), 'authinstance', $_instanceid);
$userrecord = record_exists_select('usr', 'LOWER(username) = ? and authinstance = ?', array(strtolower($username), $_instanceid));
}
if (empty($userrecord)) {
$_instanceid = $this->instanceid;
$userrecord = get_record('usr', 'LOWER(username)', strtolower($username), 'authinstance', $_instanceid);
$userrecord = record_exists_select('usr', 'LOWER(username) = ? and authinstance = ?', array(strtolower($username), $_instanceid));
}
if ($userrecord != false) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment