r76033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76032‎ | r76033 | r76034 >
Date:21:03, 4 November 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added new global variable, $egApprovedRevsAutomaticApprovals
Modified paths:
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApprovedRevs/ApprovedRevs.php
@@ -26,6 +26,7 @@
2727 $egApprovedRevsScriptPath = $wgScriptPath . '/extensions/ApprovedRevs';
2828 $egApprovedRevsNamespaces = array( NS_MAIN, NS_TEMPLATE, NS_HELP, NS_PROJECT );
2929 $egApprovedRevsBlankIfUnapproved = false;
 30+$egApprovedRevsAutomaticApprovals = true;
3031
3132 // internationalization
3233 $wgExtensionMessagesFiles['ApprovedRevs'] = $egApprovedRevsIP . 'ApprovedRevs.i18n.php';
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -47,12 +47,12 @@
4848 }
4949
5050 /**
51 - * If the user saving this page has approval power, and the page
52 - * is approvable, and either (a) this page already has an approved
53 - * revision, or (b) unapproved pages are shown as blank on this
54 - * wiki, automatically set this latest revision to be the approved
55 - * one - don't bother logging the approval, though; the log is
56 - * reserved for manual approvals.
 51+ * If the user saving this page has approval power, and automatic
 52+ * approvals are enabled, and the page is approvable, and either
 53+ * (a) this page already has an approved revision, or (b) unapproved
 54+ * pages are shown as blank on this wiki, automatically set this
 55+ * latest revision to be the approved one - don't bother logging
 56+ * the approval, though; the log is reserved for manual approvals.
5757 */
5858 static public function setLatestAsApproved( &$article ) {
5959 $title = $article->getTitle();
@@ -60,6 +60,11 @@
6161 return true;
6262 }
6363
 64+ global $egApprovedRevsAutomaticApprovals;
 65+ if ( ! $egApprovedRevsAutomaticApprovals ) {
 66+ return true;
 67+ }
 68+
6469 if ( !ApprovedRevs::pageIsApprovable( $title ) ) {
6570 return true;
6671 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r76042added r76033 to stand alone release versiondale21:29, 4 November 2010

Status & tagging log