]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Normalize username on AuthCrypt login
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 25 Feb 2015 23:45:17 +0000 (00:45 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 25 Feb 2015 23:45:17 +0000 (00:45 +0100)
Because users login with mixed casing and whatnot.

plugins/AuthCrypt/AuthCryptPlugin.php

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