We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 206376cf authored by Evan Prodromou's avatar Evan Prodromou

use Start/EndRegistrationTry events for email registration

parent 6267ea2e
......@@ -252,6 +252,7 @@ class EmailregisterAction extends Action
function setPassword()
{
if (Event::handle('StartRegistrationTry', array($this))) {
if (!empty($this->invitation)) {
$email = $this->invitation->address;
} else if (!empty($this->confirmation)) {
......@@ -278,6 +279,13 @@ class EmailregisterAction extends Action
throw new Exception("Failed to register user.");
}
common_set_user($this->user);
// this is a real login
common_real_login(true);
// Re-init language env in case it changed (not yet, but soon)
common_init_language();
if (!empty($this->invitation)) {
$inviter = User::staticGet('id', $this->invitation->user_id);
if (!empty($inviter)) {
......@@ -292,6 +300,9 @@ class EmailregisterAction extends Action
throw new Exception('No confirmation thing.');
}
Event::handle('EndRegistrationTry', array($this));
}
common_redirect(common_local_url('doc', array('title' => 'welcome')),
303);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment