Show notice if user is globally blocked

Bug: 53009
Change-Id: I5c8a31f40535e7495133738a03d83648d57fb526
This commit is contained in:
Alex Monk 2014-04-22 01:22:48 +01:00
parent 6e02932c3a
commit cb9022bfe3

View file

@ -391,6 +391,19 @@ class ApiVisualEditor extends ApiBase {
)->parseAsBlock();
}
if ( class_exists( 'GlobalBlocking' ) ) {
$error = GlobalBlocking::getUserBlockErrors(
$user,
$this->getRequest()->getIP()
);
if ( count( $error ) ) {
$notices[] = call_user_func_array(
array( $this, 'msg' ),
$error
)->parseAsBlock();
}
}
// HACK: Build a fake EditPage so we can get checkboxes from it
$article = new Article( $page ); // Deliberately omitting ,0 so oldid comes from request
$ep = new EditPage( $article );