Archived
1
0
Fork 0

app/models/Data/User.php: in findFirstByUsernameOrEmail() only select active users.

This commit is contained in:
Henrik Hautakoski 2018-08-10 20:30:59 +02:00
parent 0e7849e5f7
commit ecf38258f5
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -281,8 +281,8 @@ class User extends Model
static public function findFirstByUsernameOrEmail($value)
{
return self::findFirst([
"email = :v: OR username = :v:",
"bind" => [ 'v' => $value ]
"(email = :v: OR username = :v:) AND status = :s:",
"bind" => [ 'v' => $value, 's' => self::STATUS_ACTIVE ]
]);
}