Merge "Use WebRequest instead of $_SERVER in OutputPage."
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogin.php
index 7d91096..adda68c 100644 (file)
@@ -274,7 +274,7 @@ class LoginForm extends SpecialPage {
 
        /**
         * @private
-        * @return bool|\User
+        * @return bool|User
         */
        function addNewAccountInternal() {
                global $wgAuth, $wgMemc, $wgAccountCreationThrottle,
@@ -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() );