Exemplo n.º 1
0
 public function indexAction()
 {
     if (null != $this->getAuth()->getUsername()) {
         return $this->redirectOk();
     }
     $login = $this->getLogin();
     $pass = $this->getPass();
     if (strlen($login) && strlen($pass)) {
         $this->authResult = $this->doLogin();
         if ($this->authResult->isValid()) {
             return $this->onLogin();
         } else {
             $this->view->error = array($this->authResult->getMessage());
         }
     } else {
         if ($this->_request->isPost()) {
             $this->view->error = array(___("Please enter username and password"));
         }
     }
     $this->view->{$this->loginField} = $login;
     $this->view->hidden = $this->getHiddenVars();
     $this->renderLoginPage();
 }