Esempio n. 1
0
 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');
 }
Esempio n. 2
0
 /**
  * @param string
  */
 public function setPassword($password)
 {
     $this->password = Authenticator::hashPassword($password);
 }