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:
Brion Vibber
2011-01-05 12:26:20 -08:00
parent fb9ecddbf1
commit d0d39b51b8
4 changed files with 25 additions and 10 deletions

View File

@@ -232,6 +232,10 @@ class FBConnectauthAction extends Action
function createNewUser()
{
if (!Event::handle('StartRegistrationTry', array($this))) {
return;
}
if (common_config('site', 'closed')) {
// TRANS: Client error trying to register with registrations not allowed.
$this->clientError(_m('Registration not allowed.'));
@@ -300,6 +304,8 @@ class FBConnectauthAction extends Action
common_debug('Facebook Connect Plugin - ' .
"Registered new user $user->id from Facebook user $this->fbuid");
Event::handle('EndRegistrationTry', array($this));
common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)),
303);
}