From: Bryan Tong Minh Date: Thu, 28 Aug 2008 20:25:53 +0000 (+0000) Subject: wfReadOnly now checked in ApiMain::requestWriteMode X-Git-Tag: 1.31.0-rc.0~45583 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=6578dd7890b1d148aa231acbe9d134db0477815a;p=lhc%2Fweb%2Fwiklou.git wfReadOnly now checked in ApiMain::requestWriteMode --- diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index 2a13c29bc8..3482148987 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -72,8 +72,6 @@ class ApiBlock extends ApiBase { $this->dieUsageMsg(array('canthide')); if($params['noemail'] && !$wgUser->isAllowed('blockemail')) $this->dieUsageMsg(array('cantblock-email')); - if(wfReadOnly()) - $this->dieUsageMsg(array('readonlytext')); $form = new IPBlockForm(''); $form->BlockAddress = $params['user']; diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 5f1dd476be..76d66fec35 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -90,8 +90,6 @@ class ApiDelete extends ApiBase { private static function getPermissionsError(&$title, $token) { global $wgUser; - // Check wiki readonly - if (wfReadOnly()) return array(array('readonlytext')); // Check permissions $errors = $title->getUserPermissionsErrors('delete', $wgUser); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index c3946e5c34..4751296bb7 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -211,6 +211,8 @@ class ApiMain extends ApiBase { if (!$wgUser->isAllowed('writeapi')) $this->dieUsage('You\'re not allowed to edit this ' . 'wiki through the API', 'writeapidenied'); + if (wfReadOnly()) + $this->dieUsageMsg(array('readonlytext')); } /** diff --git a/includes/api/ApiUnblock.php b/includes/api/ApiUnblock.php index cf98f0f229..acfeb9a1c9 100644 --- a/includes/api/ApiUnblock.php +++ b/includes/api/ApiUnblock.php @@ -64,8 +64,6 @@ class ApiUnblock extends ApiBase { $this->dieUsageMsg(array('sessionfailure')); if(!$wgUser->isAllowed('block')) $this->dieUsageMsg(array('cantunblock')); - if(wfReadOnly()) - $this->dieUsageMsg(array('readonlytext')); $id = $params['id']; $user = $params['user']; diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index 412e283788..f54511b5bc 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -51,8 +51,6 @@ class ApiUndelete extends ApiBase { $this->dieUsageMsg(array('permdenied-undelete')); if($wgUser->isBlocked()) $this->dieUsageMsg(array('blockedtext')); - if(wfReadOnly()) - $this->dieUsageMsg(array('readonlytext')); if(!$wgUser->matchEditToken($params['token'])) $this->dieUsageMsg(array('sessionfailure'));