public function process(UserInterface $user = null, $confirmation = null)
{
if (null === $user) {
$user = $this->userManager->createUser();
}
$this->setData($user);
if ('POST' == $this->request->getMethod()) {
$this->bind($this->request);
if ($this->isValid()) {
if (true === $confirmation) {
$user->setEnabled(false);
} else {
if (false === $confirmation) {
$user->setConfirmationToken(null);
$user->setEnabled(true);
}
}
$this->userManager->updateUser($user);
return true;
}
}
return false;
}