예제 #1
0
 /**
  * action update
  *
  * @param \In2\Femanager\Domain\Model\User $user
  * @validate $user In2\Femanager\Domain\Validator\ServersideValidator
  * @validate $user In2\Femanager\Domain\Validator\PasswordValidator
  * @validate $user In2\Femanager\Domain\Validator\CaptchaValidator
  * @return void
  */
 public function updateAction(User $user)
 {
     // check if there are no changes
     if (!Div::isDirtyObject($user)) {
         $this->flashMessageContainer->add(LocalizationUtility::translate('noChanges', 'femanager'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
         $this->redirect('edit');
     }
     // overwrite values from TypoScript
     $user = $this->div->forceValues($user, $this->config['edit.']['forceValues.']['beforeAnyConfirmation.'], $this->cObj);
     if ($this->settings['edit']['fillEmailWithUsername'] == 1) {
         $user->setEmail($user->getUsername());
     }
     // convert password to md5 or sha1 hash
     if (array_key_exists('password', Div::getDirtyPropertiesFromObject($user))) {
         Div::hashPassword($user, $this->settings['edit']['misc']['passwordSave']);
     }
     $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'BeforePersist', array($user, $this));
     if (!empty($this->settings['edit']['confirmByAdmin'])) {
         $this->updateRequest($user);
     } else {
         $this->updateAllConfirmed($user);
     }
     $this->redirect('edit');
 }