forked from GNUsocial/gnu-social
Fixes for RegisterThrottle plugin: alt registration methods (OpenID, FBConnect, Twitter) weren't triggering the throttle check or recording of IPs.
Added StartRegistrationTry/EndRegistrationTry calls into those three, and moved the actual recording hook to EndUserRegister which is guaranteed to be called from User::register (so we don't need to worry about other auth methods forgetting to call the other UI-code hooks).
This commit is contained in:
@@ -247,6 +247,10 @@ class FinishopenidloginAction extends Action
|
||||
{
|
||||
# FIXME: save invite code before redirect, and check here
|
||||
|
||||
if (!Event::handle('StartRegistrationTry', array($this))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (common_config('site', 'closed')) {
|
||||
// TRANS: OpenID plugin message. No new user registration is allowed on the site.
|
||||
$this->clientError(_m('Registration not allowed.'));
|
||||
@@ -362,6 +366,9 @@ class FinishopenidloginAction extends Action
|
||||
common_rememberme($user);
|
||||
}
|
||||
unset($_SESSION['openid_rememberme']);
|
||||
|
||||
Event::handle('EndRegistrationTry', array($this));
|
||||
|
||||
common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)),
|
||||
303);
|
||||
}
|
||||
|
Reference in New Issue
Block a user