function handleLogin($user, $pass, $ip) { switch (rand(1, 3)) { case 1: $this->setStatus(self::LOGIN_ACCESS, $user, $ip); $ret = true; break; case 2: $this->setStatus(self::LOGIN_WRONG_PASS, $user, $ip); $ret = false; break; case 3: $this->setStatus(self::LOGIN_USER_UNKNOWN, $user, $ip); $ret = false; break; } Logger::logIP($user, $ip, $this->getStatus()); if (!$ret) { Notifier::mailWarning($user, $ip, $this->getStatus()); } return $ret; }