From d27b15901e6536bddfc20e7f2987c74be0b05363 Mon Sep 17 00:00:00 2001 From: csteipp Date: Fri, 20 Jul 2012 11:54:14 -0700 Subject: [PATCH] (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 --- includes/specials/SpecialUserlogin.php | 6 ++++++ 1 file changed, 6 insertions(+) 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() ); -- 2.20.1