Example #1
0
 protected function VerifyLogin($username, $password_md5, $password_length)
 {
     try {
         $this->user = User::FindByName($username);
     } catch (Exception $e) {
         // User not found
         throw new Session_AccessViolationException('Login failed: username and/or password are incorrect.');
     }
     // Verify password
     if (!$this->user->VerifyPassword($password_md5, $password_length)) {
         $this->user = null;
         throw new Session_AccessViolationException('Login failed: username and/or password are incorrect.');
     }
 }