Exemplo 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)
 {
     $this->allowedUserForInvitationNewAndCreate();
     $user->setDisable(true);
     $user = FrontendUtility::forceValues($user, $this->config['invitation.']['forceValues.']['beforeAnyConfirmation.']);
     $user = UserUtility::fallbackUsernameAndPassword($user);
     if ($this->settings['invitation']['fillEmailWithUsername'] === '1') {
         $user->setEmail($user->getUsername());
     }
     UserUtility::hashPassword($user, $this->settings['invitation']['misc']['passwordSave']);
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'BeforePersist', [$user, $this]);
     $this->createAllConfirmed($user);
 }
Exemplo n.º 2
0
 /**
  * Status action: Admin confirmation
  *
  * @param User $user
  * @param string $hash
  * @param string $status
  * @return bool allow further functions
  */
 protected function statusAdminConfirmation(User $user, $hash, $status)
 {
     if (HashUtility::validHash($hash, $user)) {
         $user = FrontendUtility::forceValues($user, $this->config['new.']['forceValues.']['onAdminConfirmation.']);
         $user->setTxFemanagerConfirmedbyadmin(true);
         $user->setDisable(false);
         $this->userRepository->update($user);
         $this->addFlashMessage(LocalizationUtility::translate('create'));
         LogUtility::log(Log::STATUS_REGISTRATIONCONFIRMEDADMIN, $user);
         $this->finalCreate($user, 'new', 'createStatus', false, $status);
     } else {
         $this->addFlashMessage(LocalizationUtility::translate('createFailedProfile'), '', FlashMessage::ERROR);
         return false;
     }
     return true;
 }
Exemplo n.º 3
0
 /**
  * Assigns all values, which should be available in all views
  *
  * @return void
  */
 public function assignForAll()
 {
     $this->view->assignMultiple(['languageUid' => FrontendUtility::getFrontendLanguageUid(), 'storagePid' => $this->allConfig['persistence']['storagePid'], 'Pid' => FrontendUtility::getCurrentPid(), 'uploadFolder' => FileUtility::getUploadFolderFromTca()]);
 }
Exemplo n.º 4
0
 /**
  * Status update confirmation
  *
  * @param User $user
  * @return void
  */
 protected function statusConfirm(User $user)
 {
     $values = GeneralUtility::xml2array($user->getTxFemanagerChangerequest());
     foreach ((array) $values as $field => $value) {
         if ($field !== 'usergroup' && method_exists($user, 'set' . ucfirst($field))) {
             $user->{'set' . ucfirst($field)}($value['new']);
         } else {
             $user->removeAllUsergroups();
             $usergroupUids = GeneralUtility::trimExplode(',', $value['new'], true);
             foreach ($usergroupUids as $usergroupUid) {
                 /** @var UserGroup $usergroup */
                 $usergroup = $this->userGroupRepository->findByUid($usergroupUid);
                 $user->addUsergroup($usergroup);
             }
         }
     }
     $user = FrontendUtility::forceValues($user, $this->config['edit.']['forceValues.']['onAdminConfirmation.']);
     LogUtility::log(Log::STATUS_PROFILEUPDATECONFIRMEDADMIN, $user);
     $this->addFlashMessage(LocalizationUtility::translate('updateProfile'));
 }