示例#1
0
 /**
  * @param \CIC\Cicregister\Domain\Model\FrontendUser $frontendUser
  * @param array $conf
  */
 public function decorate(\CIC\Cicregister\Domain\Model\FrontendUser $frontendUser, $conf = array())
 {
     $groupUid = $conf['groupUid'];
     if ($groupUid) {
         $group = $this->frontendUserGroupRepository->findByUid($groupUid);
         if ($group instanceof \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup) {
             $frontendUser->addUsergroup($group);
         }
     }
 }
 /**
  * @param \CIC\Cicregister\Domain\Model\FrontendUser $frontendUser
  * @return mixed
  */
 protected function createAndPersistUser(\CIC\Cicregister\Domain\Model\FrontendUser $frontendUser)
 {
     // add the user to the default group
     $defaultGroup = $this->frontendUserGroupRepository->findByUid($this->settings['defaults']['globalGroupId']);
     if ($defaultGroup instanceof \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup) {
         $frontendUser->addUsergroup($defaultGroup);
     }
     $this->decorateUser($frontendUser, 'created');
     // add the user to the repository
     $this->frontendUserRepository->add($frontendUser);
     $this->flashMessageContainer->add('Your account has been created.');
     // persist the user
     $this->persistenceManager->persistAll();
     return $this->doBehaviors($frontendUser, 'created', 'createConfirmation');
 }