Add registration events to EmailregisterAction

This commit is contained in:
Zach Copley 2011-04-28 15:53:17 -07:00
parent d9d9a10b6f
commit cd0d7be251

View File

@ -240,6 +240,7 @@ class EmailregisterAction extends Action
function setPassword() function setPassword()
{ {
if (Event::handle('StartRegistrationTry', array($this))) {
if (!empty($this->invitation)) { if (!empty($this->invitation)) {
$email = trim($this->invitation->address); $email = trim($this->invitation->address);
} else if (!empty($this->confirmation)) { } else if (!empty($this->confirmation)) {
@ -310,8 +311,14 @@ class EmailregisterAction extends Action
throw new Exception('No confirmation thing.'); throw new Exception('No confirmation thing.');
} }
Event::handle('EndRegistrationTry', array($this));
}
if (Event::handle('StartRegisterSuccess', array($this))) {
common_redirect(common_local_url('doc', array('title' => 'welcome')), common_redirect(common_local_url('doc', array('title' => 'welcome')),
303); 303);
Event::handle('EndRegisterSuccess', array($this));
}
} }
function sendConfirmEmail($confirm) function sendConfirmEmail($confirm)