r12241 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r12240 | r12241 (on ViewVC) | r12242 >
Date:19:55, 25 December 2005
Author:vibber
Status:new
Tags:
Comment:* Add 'deletedhistory' permission key for ability to view deleted history
list via Special:Undelete. Default is off, replicating the 1.5 behavior,
but it can be turned back on for random users to replicate the previous
1.6 dev behavior.

Gotten a rash of requests lately to delete history items, which then still
show their forbidden details to the whole world. Until we get this sorted
out to be easier to work with, I'm disabling the view of deleted history
for non-sysops on wikimedia.
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 12240)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 12241)
@@ -801,6 +801,7 @@
 $wgGroupPermissions['sysop']['block']           = true;
 $wgGroupPermissions['sysop']['createaccount']   = true;
 $wgGroupPermissions['sysop']['delete']          = true;
+$wgGroupPermissions['sysop']['deletedhistory']  = true; // can view deleted history entries, but not see or restore the text
 $wgGroupPermissions['sysop']['editinterface']   = true;
 $wgGroupPermissions['sysop']['import']          = true;
 $wgGroupPermissions['sysop']['importupload']    = true;
Index: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php	(revision 12240)
+++ trunk/phase3/includes/Skin.php	(revision 12241)
@@ -644,7 +644,8 @@
 
 	function getUndeleteLink() {
 		global $wgUser, $wgTitle, $wgContLang, $action;
-		if(	(($wgTitle->getArticleId() == 0) || ($action == "history")) &&
+		if(	$wgUser->isAllowed( 'deletedhistory' ) &&
+			(($wgTitle->getArticleId() == 0) || ($action == "history")) &&
 			($n = $wgTitle->isDeleted() ) ) 
 		{
 			if ( $wgUser->isAllowed( 'delete' ) ) {
Index: trunk/phase3/includes/SpecialPage.php
===================================================================
--- trunk/phase3/includes/SpecialPage.php	(revision 12240)
+++ trunk/phase3/includes/SpecialPage.php	(revision 12241)
@@ -70,7 +70,7 @@
 	'Allmessages'	=> new SpecialPage( 'Allmessages' ),
 	'Log'           => new SpecialPage( 'Log' ),
 	'Blockip'		=> new SpecialPage( 'Blockip', 'block' ),
-	'Undelete'		=> new SpecialPage( 'Undelete' ),
+	'Undelete'		=> new SpecialPage( 'Undelete', 'deletedhistory' ),
 	"Import"		=> new SpecialPage( "Import", 'import' ),
 	'Lockdb'		=> new SpecialPage( 'Lockdb', 'siteadmin' ),
 	'Unlockdb'		=> new SpecialPage( 'Unlockdb', 'siteadmin' ),
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 12240)
+++ trunk/phase3/RELEASE-NOTES	(revision 12241)
@@ -354,6 +354,10 @@
   to vanish mysteriously from time to time for files that didn't have metadata.
 * Added 'PageRenderingHash' hook for changing the parser cache hash key
   from an extension that changes rendering based on nonstandard options.
+* Add 'deletedhistory' permission key for ability to view deleted history
+  list via Special:Undelete. Default is off, replicating the 1.5 behavior,
+  but it can be turned back on for random users to replicate the previous
+  1.6 dev behavior.
 
 
 === Caveats ===
Views
Toolbox