Пример #1
0
 protected function createAuthUser()
 {
     if (!$this->existsVar(self::AUTH_USER)) {
         $authUser = Gpf::newObj(Gpf_Application::getInstance()->getAuthClass());
         $this->authUser = $authUser->createAnonym();
         $this->save($this->authUser);
     } else {
         $this->authUser = $this->getVar(self::AUTH_USER);
     }
     $this->authUser->init();
 }
Пример #2
0
 protected function setAuthenticationSucesful(Gpf_Rpc_Form $loginForm, Gpf_Auth_User $authUser)
 {
     try {
         if ($loginForm->getFieldValue(self::REMEMBER_ME) == Gpf::YES) {
             $authUser->saveRememberMeCookie();
         }
     } catch (Gpf_Exception $e) {
     }
     $authUser->setLanguage($loginForm->getFieldValue(self::LANGUAGE));
     Gpf_Db_UserAttribute::saveAttribute(self::LANGUAGE, $loginForm->getFieldValue(self::LANGUAGE), $authUser->getAccountUserId());
     Gpf_Db_UserAttribute::saveAttribute(self::TIME_OFFSET, Gpf_Session::getInstance()->getTimeOffset(), $authUser->getAccountUserId());
     Gpf_Http::setCookie(self::COOKIE_LANGUAGE, $authUser->getLanguage(), time() + 20000000, '/');
     $loginForm->addField("S", Gpf_Session::getInstance()->getId());
     $loginForm->setInfoMessage($this->_("User authenticated. Logging in."));
     Gpf_Log::info($this->_sys("User %s authenticated. Logging in.", $authUser->getUsername()));
 }
Пример #3
0
 public function init()
 {
     $this->theme = '';
     parent::init();
 }
Пример #4
0
 protected function loadAuthData(Gpf_Data_Record $data)
 {
     parent::loadAuthData($data);
     $this->userId = $data->get("userid");
     $this->type = $data->get("rtype");
     $this->userData = $data;
 }