From 0d901b87afbb986a54afeae5e992f4aac7d04ee1 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 21 Oct 2008 00:04:33 +0000 Subject: [PATCH] (bug 2508) Don't show edit button if user is blocked, show 'viewsource' instead. --- RELEASE-NOTES | 1 + includes/Skin.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 08902a927c..1f906041e1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -276,6 +276,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 15605) Enabled $datePreferences for language 'hr'. Added standard date preferences. * (bug 13701) {{NUMBEROFVIEWS}} magic word to show number of total views. +* (bug 2508) Don't show edit button if user is blocked from editing === API changes in 1.14 === diff --git a/includes/Skin.php b/includes/Skin.php index b1336ee8c6..3cdccf7479 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1448,14 +1448,14 @@ END; } function editThisPage() { - global $wgOut, $wgTitle; + global $wgOut, $wgTitle, $wgUser; if ( !$wgOut->isArticleRelated() ) { $s = wfMsg( 'protectedpage' ); } else { - if( $wgTitle->quickUserCan( 'edit' ) && $wgTitle->exists() ) { + if( $wgTitle->quickUserCan( 'edit' ) && $wgTitle->exists() && !$wgUser->isBlocked() ) { $t = wfMsg( 'editthispage' ); - } elseif( $wgTitle->quickUserCan( 'create' ) && !$wgTitle->exists() ) { + } elseif( $wgTitle->quickUserCan( 'create' ) && !$wgTitle->exists() && !$wgUser->isBlocked() ) { $t = wfMsg( 'create-this-page' ); } else { $t = wfMsg( 'viewsource' ); -- 2.20.1