Actually block blocked users in the Parsoid API

Change-Id: I29b938bb5c1ea00886cb2b0ab04121e4d4cd1890
This commit is contained in:
Catrope 2012-06-21 13:55:33 -07:00
parent d245ac030e
commit e16346385d

View file

@ -28,7 +28,9 @@ class ApiVisualEditor extends ApiBase {
} else {
$result = array( 'result' => 'success', 'parsed' => '' );
}
} elseif ( $params['paction'] === 'save' ) {
} elseif ( $params['paction'] === 'save' && $wgUser->isBlocked() ) {
$result = array( 'result' => 'error' );
} elseif ( $params['paction'] === 'save' /* means user is not blocked */ ) {
// API Posts HTML to Parsoid Service, receives Wikitext,
// API Saves Wikitext to page.
$wikitext = Http::post( $parsoid . $page->getPrefixedDBkey(),