Skip to content

Commit

Permalink
Dev: checkPassword on null
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Nov 3, 2017
1 parent 8cc8557 commit 66ff11e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/core/plugins/Authdb/Authdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ public function newUserSession()
$this->setUsername($user->users_name);
}
}

if ($user !== null && $user->uid != 1 && !Permission::model()->hasGlobalPermission('auth_db','read',$user->uid))
{
$this->setAuthFailure(self::ERROR_AUTH_METHOD_INVALID, gT('Internal database authentication method is not allowed for this user'));
return;
}

if ($user === null) {
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
return;
}
if ($user !== null && ($username!=$user->users_name && $username!=$user->email)) // Control of equality for uppercase/lowercase with mysql
{
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
Expand Down

0 comments on commit 66ff11e

Please sign in to comment.