Fix case sensitive for username in login form
A crutch to work not only in mysql.
This commit is contained in:
parent
729127a053
commit
bd4b7a8f83
1 changed files with 14 additions and 2 deletions
|
@ -102,10 +102,22 @@ class Load extends Action
|
|||
$vars = [
|
||||
':name' => $name,
|
||||
];
|
||||
$where = $caseInsencytive ? 'LOWER(u.username)=LOWER(?s:name)' : 'u.username=?s:name';
|
||||
$where = 'u.username=?s:name';
|
||||
$query = $this->getSql($where);
|
||||
|
||||
return $this->returnUser($query, $vars);
|
||||
$user = $this->returnUser($query, $vars);
|
||||
|
||||
if (
|
||||
! $user instanceof User
|
||||
|| (
|
||||
false === $caseInsencytive
|
||||
&& $name !== $user->username
|
||||
)
|
||||
) {
|
||||
return null;
|
||||
} else {
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue