Exemplo n.º 1
0
 /**
  * Called if login procedure initiated.
  */
 protected function doLogin()
 {
     $post = HttpHelper::getPost();
     if (!$post) {
         return false;
     }
     $user = NULL;
     try {
         $user = new User($post['username'], NULL, $post['password']);
     } catch (Exception $e) {
     }
     if (!$user || !$this->checkUserValidity($user)) {
         $this->status = self::FAILED_LOGIN;
         return false;
     }
     $this->status = self::REDIRECTING;
     HttpHelper::setCookies($user);
     HttpHelper::redirect('/');
     // exits script
 }