|
|
|
@ -19,6 +19,7 @@ class Action extends Main
|
|
|
|
|
$invite = $this->post('invite');
|
|
|
|
|
$username = $this->post('username');
|
|
|
|
|
$password = $this->post('password');
|
|
|
|
|
$email = $this->post('email');
|
|
|
|
|
|
|
|
|
|
/** @var User $user */
|
|
|
|
|
$user = $this->get('user');
|
|
|
|
@ -30,12 +31,16 @@ class Action extends Main
|
|
|
|
|
$newUser = null;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$newUser = $user->register($invite, $username, $password);
|
|
|
|
|
$newUser = $user->register($invite, $username, $email, $password);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
$segment->setFlash("error", $e->getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($newUser === null) {
|
|
|
|
|
$segment->setFlash('username', $username);
|
|
|
|
|
$segment->setFlash('email', $email);
|
|
|
|
|
$segment->setFlash('invite', $invite);
|
|
|
|
|
|
|
|
|
|
return $this->redirect('/register');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|