jenkins-bot has submitted this change and it was merged.

Change subject: Simplify GlobalBlocking code
......................................................................


Simplify GlobalBlocking code

Depends-On: I2893b9e24173d21fe518c360f6c6add363cc7b23
Change-Id: I242e5daaeda4e981099228ffa860b274a9794127
---
M ApiVisualEditor.php
1 file changed, 5 insertions(+), 11 deletions(-)

Approvals:
  Alex Monk: Looks good to me, approved
  Jforrester: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index 535f430..4d5f4f1 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -477,17 +477,11 @@
                                }
 
                                // Blocked user notice for global blocks
-                               if ( class_exists( 'GlobalBlocking' ) ) {
-                                       $error = 
GlobalBlocking::getUserBlockErrors(
-                                               $user,
-                                               $this->getRequest()->getIP()
-                                       );
-                                       if ( count( $error ) ) {
-                                               $notices[] = 
call_user_func_array(
-                                                       [ $this, 'msg' ],
-                                                       $error
-                                               )->parseAsBlock();
-                                       }
+                               if ( $user->isBlockedGlobally() ) {
+                                       $notices[] = call_user_func_array(
+                                               [ $this, 'msg' ],
+                                               
$user->getGlobalBlock()->getPermissionsError( $this->getContext() )
+                                       )->parseAsBlock();
                                }
 
                                // HACK: Build a fake EditPage so we can get 
checkboxes from it

-- 
To view, visit https://gerrit.wikimedia.org/r/285293
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I242e5daaeda4e981099228ffa860b274a9794127
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to