r45944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45943‎ | r45944 | r45945 >
Date:23:37, 20 January 2009
Author:mrzman
Status:ok
Tags:
Comment:
Make API action=delete respect $wgDeleteRevisionsLimit
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiDelete.php
@@ -79,6 +79,11 @@
8080 $this->dieUsageMsg(current($retval));
8181 } else {
8282 $articleObj = new Article($titleObj);
 83+ $bigHistory = $articleObj->isBigDeletion();
 84+ if( $bigHistory && !$wgUser->isAllowed( 'bigdelete' ) ) {
 85+ global $wgDeleteRevisionsLimit;
 86+ $this->dieUsageMsg(array('delete-toobig', $wgDeleteRevisionsLimit));
 87+ }
8388 $retval = self::delete($articleObj, $params['token'], $reason);
8489
8590 if(count($retval))
Index: trunk/phase3/includes/api/ApiBase.php
@@ -698,6 +698,7 @@
699699 '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"),
700700 'rcpatroldisabled' => array('code' => 'patroldisabled', 'info' => "Patrolling is disabled on this wiki"),
701701 'markedaspatrollederror-noautopatrol' => array('code' => 'noautopatrol', 'info' => "You don't have permission to patrol your own changes"),
 702+ 'delete-toobig' => array('code' => 'bigdelete', 'info' => "You can't delete this page because it has more than \$1 revisions"),
702703
703704 // API-specific messages
704705 'missingparam' => array('code' => 'no$1', 'info' => "The \$1 parameter must be set"),
Index: trunk/phase3/RELEASE-NOTES
@@ -66,6 +66,7 @@
6767 * (bug 17048) Show the 'new' flag in list=usercontribs for the revision that created the
6868 page, even if it's not the top revision
6969 * (bug 17069) Added ucshow=patrolled|!patrolled to list=usercontribs
 70+* action=delete respects $wgDeleteRevisionsLimit and the bigdelete user right
7071
7172 === Languages updated in 1.15 ===
7273

Follow-up revisions

RevisionCommit summaryAuthorDate
r45954Fix indentation for r45944 and use consistent code stylecatrope09:21, 21 January 2009

Status & tagging log