Exemplo n.º 1
0
 public function indexAction()
 {
     $this->view->errorLogin = false;
     if (Fw_Auth::isValid()) {
         Fw_Request::redirect(C::uri(array('donors', Fw_Auth::get('id'))));
     } else {
         $login = Fw_Request::post('login', null);
         $password = Fw_Request::post('password', null);
         $referer = base64_decode(Fw_Request::post('referer', null));
         if (!is_null($password) && !is_null($login)) {
             if (Fw_Request::validLogin($login)) {
                 if (Fw_Auth::start($login, $password)) {
                     Fw_Request::redirect($referer);
                 } else {
                     $this->view->errorLogin = true;
                 }
             } else {
                 $this->view->errorLogin = true;
             }
             $this->view->referer = $referer;
         }
         $this->view->render();
     }
 }