Merge "Show notice if user is globally blocked"

This commit is contained in:
jenkins-bot 2014-04-22 23:02:26 +00:00 committed by Gerrit Code Review
commit c034e31404

View file

@ -368,6 +368,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 );