Esempio n. 1
0
 /**
  * action create
  *
  * @param User $user
  * @validate $user In2code\Femanager\Domain\Validator\ServersideValidator
  * @validate $user In2code\Femanager\Domain\Validator\PasswordValidator
  * @validate $user In2code\Femanager\Domain\Validator\CaptchaValidator
  * @return void
  */
 public function createAction(User $user)
 {
     $user = UserUtility::overrideUserGroup($user, $this->settings);
     $user = FrontendUtility::forceValues($user, $this->config['new.']['forceValues.']['beforeAnyConfirmation.']);
     $user = UserUtility::fallbackUsernameAndPassword($user);
     $user = UserUtility::takeEmailAsUsername($user, $this->settings);
     UserUtility::hashPassword($user, $this->settings['new']['misc']['passwordSave']);
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'BeforePersist', [$user, $this]);
     if ($this->isAllConfirmed()) {
         $this->createAllConfirmed($user);
     } else {
         $this->createRequest($user);
     }
 }
Esempio n. 2
0
 /**
  * action update
  *
  * @param \In2code\Femanager\Domain\Model\User $user
  * @validate $user In2code\Femanager\Domain\Validator\ServersideValidator
  * @validate $user In2code\Femanager\Domain\Validator\PasswordValidator
  * @return void
  */
 public function updateAction($user)
 {
     $this->addFlashMessage(LocalizationUtility::translate('createAndInvitedFinished'));
     LogUtility::log(Log::STATUS_INVITATIONPROFILEENABLED, $user);
     if ($this->settings['invitation']['notifyAdmin']) {
         $this->sendMailService->send('invitationNotify', StringUtility::makeEmailArray($this->settings['invitation']['notifyAdmin'], $this->settings['invitation']['email']['invitationAdminNotify']['receiver']['name']['value']), StringUtility::makeEmailArray($user->getEmail(), $user->getUsername()), 'Profile creation with invitation - Final', ['user' => $user, 'settings' => $this->settings], $this->config['invitation.']['email.']['invitationAdminNotify.']);
     }
     $user = UserUtility::overrideUserGroup($user, $this->settings, 'invitation');
     UserUtility::hashPassword($user, $this->settings['invitation']['misc']['passwordSave']);
     $this->userRepository->update($user);
     $this->persistenceManager->persistAll();
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'AfterPersist', [$user, $this]);
     $this->redirectByAction('invitation', 'redirectPasswordChanged');
     $this->redirect('status');
 }