From: csteipp Date: Fri, 20 Jul 2012 18:54:14 +0000 (-0700) Subject: (bug 38333) Check global blocks on account create X-Git-Tag: 1.31.0-rc.0~22979^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=d27b15901e6536bddfc20e7f2987c74be0b05363;p=lhc%2Fweb%2Fwiklou.git (bug 38333) Check global blocks on account create Before displaying an account creation form, checks against GlobalBlocking are run, but not when the actual account is created. At this time, User::isBlockedFromCreateAccount() does not run the hooks for which GlobalBlocking is registered. Change-Id: Ieb3696bc49d6f4c4e3e95d8c55121b7ffa07b506 --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 613e3b9705..adda68c1fe 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -331,6 +331,12 @@ class LoginForm extends SpecialPage { return false; } + # Include checks that will include GlobalBlocking (Bug 38333) + $permErrors = $this->getTitle()->getUserPermissionsErrors( 'createaccount', $currentUser, true ); + if ( count( $permErrors ) ) { + throw new PermissionsError( 'createaccount', $permErrors ); + } + $ip = $this->getRequest()->getIP(); if ( $currentUser->isDnsBlacklisted( $ip, true /* check $wgProxyWhitelist */ ) ) { $this->mainLoginForm( $this->msg( 'sorbs_create_account_reason' )->text() . ' ' . $this->msg( 'parentheses', $ip )->escaped() );