Beispiel #1
0
 /**
  * Авторизация
  * 
  * @return void
  */
 public function signinAction()
 {
     if (isset($this->_params["login"]) && isset($this->_params["passw"])) {
         if ($UserInfo = $this->User->getUserInfo(array("username" => $this->_params["login"], "passw" => md5($this->_params["passw"])))) {
             if ($UserInfo["visible"] == "yes") {
                 if ($this->User->isAllowedHost($UserInfo)) {
                     $this->User->_usersession->UserData = $UserInfo;
                     $this->User->saveUserInfo(array("userid" => $UserInfo['userid'], 'lastvisit' => time(), 'lastip' => $this->_request->getClientIp()));
                     if (isset($this->User->_usersession->Refferer)) {
                         return $this->_redirect($this->User->_usersession->Refferer);
                     } else {
                         return $this->_redirect($this->cnf["site"]["url"]);
                     }
                 } else {
                     $this->view->assign("Errors", array($this->_translate->_("Доступ с вашего IP запрещен")));
                 }
             } else {
                 $this->view->assign("Errors", array($this->_translate->_("Ваша учетная запись неактивна")));
             }
         } else {
             $this->view->assign("Errors", array($this->_translate->_("Неверное имя пользователя или пароль")));
         }
     }
 }