Block password resets from globally blocked IP addresses
authorAndrew Garrett <werdna@users.mediawiki.org>
Tue, 16 Jun 2009 17:10:17 +0000 (17:10 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Tue, 16 Jun 2009 17:10:17 +0000 (17:10 +0000)
docs/hooks.txt
includes/specials/SpecialUserlogin.php

index 0258873..9e6203a 100644 (file)
@@ -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
        
index 250a12d..9a3ab39 100644 (file)
@@ -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' ) ) {