Normalize username on AuthCrypt login

Because users login with mixed casing and whatnot.
This commit is contained in:
Mikael Nordfeldth 2015-02-26 00:45:17 +01:00
parent 4eab52ee75
commit 0b09e4bfcb

View File

@ -44,6 +44,8 @@ class AuthCryptPlugin extends AuthenticationPlugin
function checkPassword($username, $password) function checkPassword($username, $password)
{ {
$username = Nickname::normalize($username);
$user = User::getKV('nickname', $username); $user = User::getKV('nickname', $username);
if (!($user instanceof User)) { if (!($user instanceof User)) {
return false; return false;
@ -81,6 +83,8 @@ class AuthCryptPlugin extends AuthenticationPlugin
// $oldpassword is already verified when calling this function... shouldn't this be private?! // $oldpassword is already verified when calling this function... shouldn't this be private?!
function changePassword($username, $oldpassword, $newpassword) function changePassword($username, $oldpassword, $newpassword)
{ {
$username = Nickname::normalize($username);
if (!$this->password_changeable) { if (!$this->password_changeable) {
return false; return false;
} }