/** @return bool */ private function isUserChangeState() { if (!$this->userStorage->isAuthenticated()) { return $this->sessionStorage->checkLogout(); } $this->sessionStorage->login(); return FALSE; }
/** * @return IIdentity|NULL */ public function getIdentity() { $identity = $this->innerUserStorage->getIdentity(); if (!$identity || !$this->identityInitializer) { return $identity; } if (!isset($this->initializedIdentities[$hash = spl_object_hash($identity)])) { $this->initializedIdentities[$hash] = $this->identityInitializer->initialize($identity); } return $this->initializedIdentities[$hash]; }
public function formSucceeded(Form $form) { try { $p = $this->getPresenter(); $values = $form->getValues(); $user = $this->userRepository->updateProfileSettings($values, $this->item); $this->userStorage->setIdentity($this->authenticator->updateIdentity($user)); $p->flashMessage($this->translator->translate('locale.settings.changed_successfully'), FlashType::SUCCESS); } catch (PossibleUniqueKeyDuplicationException $e) { $this->addFormError($form, $e); } catch (\Exception $e) { $this->addFormError($form, $e, $this->translator->translate('locale.error.occurred')); } $p->redirect('this'); }
/** * @param string|int|\DateTime $time * @param bool $browserClosed */ public function setExpiration($time, $browserClosed = true) { $this->storage->setExpiration($time, $browserClosed ? IUserStorage::BROWSER_CLOSED : 0); }