/**
  * Create a user for administration
  *
  * The user will get the SystemAdministrator role to manage all data and users.
  *
  * @param string $emailAddress E-mail address (account identifier) of the new user
  * @return void
  */
 public function createUserCommand($emailAddress)
 {
     $uuid = \TYPO3\FLOW3\Utility\Algorithms::generateUUID();
     $password = substr($uuid, 0, 10);
     $user = new \Planetflow3\Domain\Model\User();
     $user->setEmailAddress($emailAddress);
     $user->setPassword($password);
     $user->setRole('SystemAdministrator');
     $this->userRepository->add($user);
     echo "Password: {$password}" . PHP_EOL;
 }
Ejemplo n.º 2
0
 /**
  * Delete action
  *
  * @param \Planetflow3\Domain\Model\User $user
  * @FLOW3\IgnoreValidation("$user")
  */
 public function deleteAction(\Planetflow3\Domain\Model\User $user)
 {
     $this->userRepository->remove($user);
     $this->addFlashMessage('User removed.', 'Success', \TYPO3\FLOW3\Error\Message::SEVERITY_NOTICE);
     $this->redirect('index');
 }