}
}
+ $this->nickname = Nickname::normalize($this->trimmed('nickname'));
$this->password1 = $this->trimmed('password1');
$this->password2 = $this->trimmed('password2');
if (!empty($cur)) {
common_redirect(common_local_url('all', array('nickname' => $cur->nickname)));
- return;
}
switch ($this->state) {
}
if (!empty($this->error)) {
- $nickname = $this->nicknameFromEmail($email);
- $this->form = new ConfirmRegistrationForm($this, $nickname, $email, $this->code);
+ $this->form = new ConfirmRegistrationForm($this, $this->nickname, $email, $this->code);
$this->showPage();
return;
}
- $nickname = $this->nicknameFromEmail($email);
-
try {
- $fields = array('nickname' => $nickname,
+ $fields = array('nickname' => $this->nickname,
'email' => $email,
'password' => $this->password1,
'email_confirmed' => true);
$this->user = User::register($fields);
} catch (ClientException $e) {
$this->error = $e->getMessage();
- $nickname = $this->nicknameFromEmail($email);
- $this->form = new ConfirmRegistrationForm($this, $nickname, $email, $this->code);
+ $this->form = new ConfirmRegistrationForm($this, $this->nickname, $email, $this->code);
$this->showPage();
return;
}
}
if (Event::handle('StartRegisterSuccess', array($this))) {
- common_redirect(common_local_url('doc', array('title' => 'welcome')),
- 303);
Event::handle('EndRegisterSuccess', array($this));
+ common_redirect(common_local_url('doc', array('title' => 'welcome')), 303);
+ // common_redirect exits, so we can't run the event _after_ it of course.
}
}