From: Andrew Garrett Date: Tue, 16 Jun 2009 17:10:17 +0000 (+0000) Subject: Block password resets from globally blocked IP addresses X-Git-Tag: 1.31.0-rc.0~41345 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=8139c8a0664a1557f2216820e5d3e4c8a852f1af;p=lhc%2Fweb%2Fwiklou.git Block password resets from globally blocked IP addresses --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 0258873a72..9e6203acb2 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1521,6 +1521,10 @@ $inject_html: Any HTML to inject after the "logged in" message. 'UserLoginForm': change to manipulate the login form $template: SimpleTemplate instance for the form +'UserLoginMailPassword': Block users from emailing passwords +$name: the username to email the password of. +&$error: out-param ÐÊthe error message to return. + 'UserLogout': before a user logs out $user: the user object that is about to be logged out diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 250a12d5fd..9a3ab39467 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -614,6 +614,13 @@ class LoginForm { $this->mainLoginForm( wfMsg( 'blocked-mailpassword' ) ); return; } + + // Check for hooks + $error = null; + if ( ! wfRunHooks( 'UserLoginMailPassword', array( $this->mName, &$error ) ) ) { + $this->mainLoginForm( $error ); + return; + } # Check against the rate limiter if( $wgUser->pingLimiter( 'mailpassword' ) ) {