From: Alex Z Date: Tue, 20 Jan 2009 23:37:39 +0000 (+0000) Subject: Make API action=delete respect $wgDeleteRevisionsLimit X-Git-Tag: 1.31.0-rc.0~43334 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=ff00dda0d0b1fe7956a5926fd65e8de951335842;p=lhc%2Fweb%2Fwiklou.git Make API action=delete respect $wgDeleteRevisionsLimit --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 34ba8cd7e7..cf427dd302 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -66,6 +66,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 17048) Show the 'new' flag in list=usercontribs for the revision that created the page, even if it's not the top revision * (bug 17069) Added ucshow=patrolled|!patrolled to list=usercontribs +* action=delete respects $wgDeleteRevisionsLimit and the bigdelete user right === Languages updated in 1.15 === diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index a94464cc2a..06abc3c6d7 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -698,6 +698,7 @@ abstract class ApiBase { 'noemail' => array('code' => 'noemail', 'info' => "The user has not specified a valid e-mail address, or has chosen not to receive e-mail from other users"), 'rcpatroldisabled' => array('code' => 'patroldisabled', 'info' => "Patrolling is disabled on this wiki"), 'markedaspatrollederror-noautopatrol' => array('code' => 'noautopatrol', 'info' => "You don't have permission to patrol your own changes"), + 'delete-toobig' => array('code' => 'bigdelete', 'info' => "You can't delete this page because it has more than \$1 revisions"), // API-specific messages 'missingparam' => array('code' => 'no$1', 'info' => "The \$1 parameter must be set"), diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 575a2590ba..8b44709dc3 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -79,6 +79,11 @@ class ApiDelete extends ApiBase { $this->dieUsageMsg(current($retval)); } else { $articleObj = new Article($titleObj); + $bigHistory = $articleObj->isBigDeletion(); + if( $bigHistory && !$wgUser->isAllowed( 'bigdelete' ) ) { + global $wgDeleteRevisionsLimit; + $this->dieUsageMsg(array('delete-toobig', $wgDeleteRevisionsLimit)); + } $retval = self::delete($articleObj, $params['token'], $reason); if(count($retval))