Skip to content

Commit

Permalink
add is_deleted checks
Browse files Browse the repository at this point in the history
  • Loading branch information
aslubsky committed Nov 26, 2013
1 parent 3d768d1 commit 664ae63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/Bazalt/Auth/Model/User.php
Expand Up @@ -179,7 +179,8 @@ public function toArray()
public static function getUserByLogin($login, $onlyPublish = false)
{
$q = ORM::select('Bazalt\\Auth\\Model\\User u')
->where('login = ?', $login);
->where('is_deleted = 0')
->andWhere('login = ?', $login);

if ($onlyPublish) {
$q->andWhere('is_active = ?', 1);
Expand Down Expand Up @@ -220,6 +221,7 @@ public static function getUserByEmail($email, $onlyPublish = false)
public static function getByLoginAndEmail($login, $email, $onlyPublish = false)
{
$q = User::select()
->andWhere('is_deleted = 0')
->where('login = ?', $login)
->andWhere('email = ?', $email);

Expand Down

0 comments on commit 664ae63

Please sign in to comment.