Exemplo n.º 1
0
 /**
  * @param UserVO $user
  * @param Session|SessionInterface $session
  * @param string $token
  * @throws UserException
  * @return int
  */
 public function registerUser(UserVO $user, Session $session, $token = null) : int
 {
     $this->checkInput($user);
     if (!$this->registrationEnabled && $token !== null && !$this->registerTokens->fetchToken($token)) {
         throw new UserException('You have to provide a valid register token!');
     }
     $userId = $this->userProvider->register($user);
     $session->set('user', $user);
     return $userId;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $token = $this->registerTokens->addToken();
     $link = sprintf('/register/?token=%s', $token);
     $output->writeln(sprintf('<info>%s</info>', $link));
 }