From b58cb3f7471d25cf2879b36945024fba9ba9fce7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 25 Dec 2005 19:55:34 +0000 Subject: [PATCH] * 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. --- RELEASE-NOTES | 4 ++++ includes/DefaultSettings.php | 1 + includes/Skin.php | 3 ++- includes/SpecialPage.php | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 29f4d0a3c9..4b536222aa 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -354,6 +354,10 @@ fully support the editing toolbar, but was found to be too confusing. 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 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e875cc46f2..0b9420067d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -801,6 +801,7 @@ $wgGroupPermissions['bot' ]['autoconfirmed'] = true; $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; diff --git a/includes/Skin.php b/includes/Skin.php index 84b7957059..c446f0e02e 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -644,7 +644,8 @@ END; 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' ) ) { diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 38c2e4289d..c7caa3c179 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -70,7 +70,7 @@ $wgSpecialPages = array( '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' ), -- 2.20.1