Пример #1
0
 /**
  * Increments the failed-login counter of a user
  *
  * @param $user_name
  */
 public static function incrementFailedLoginCounterOfUser($user_name)
 {
     if (self::$addFailedLoginQuery === null) {
         self::$addFailedLoginQuery = DatabaseFactory::getFactory()->getConnection()->prepare("UPDATE users\n                   SET user_failed_logins = user_failed_logins+1, user_last_failed_login = :user_last_failed_login\n                 WHERE user_name = :user_name OR user_email = :user_name\n                 LIMIT 1");
     }
     self::$addFailedLoginQuery->execute(array(':user_name' => $user_name, ':user_last_failed_login' => time()));
 }