From: Rob Church Date: Fri, 6 Jan 2006 23:21:38 +0000 (+0000) Subject: Prevent blocked users from using delete and undelete X-Git-Tag: 1.6.0~742 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=9b8c2adb267be9f69fc29c00d0c6b0466b9af1bf;p=lhc%2Fweb%2Fwiklou.git Prevent blocked users from using delete and undelete --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 27fa13e86c..4112e378a9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -411,7 +411,7 @@ fully support the editing toolbar, but was found to be too confusing. which are not of known image types. This is in response to http://en.wikipedia.org/wiki/Windows_Metafile_vulnerability * (bug 4507) Adjust FULLPAGENAMEE escaping to standard form -* Disallow users to use rollback when blocked +* Blocked users can no longer use rollback, or delete/undelete pages === Caveats === diff --git a/includes/Article.php b/includes/Article.php index c5ef0cedbc..077785cc75 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1686,10 +1686,16 @@ class Article { # This code desperately needs to be totally rewritten # Check permissions - if( ( !$wgUser->isAllowed( 'delete' ) ) ) { + if( $wgUser->isAllowed( 'delete' ) ) { + if( $wgUser->isBlocked() ) { + $wgOut->blockedPage(); + return; + } + } else { $wgOut->sysopRequired(); return; } + if( wfReadOnly() ) { $wgOut->readOnlyPage(); return; diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 8d3f858458..657b4b5d81 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -319,7 +319,7 @@ class UndeleteForm { if( $par != "" ) { $this->mTarget = $par; } - if ( $wgUser->isAllowed( 'delete' ) ) { + if ( $wgUser->isAllowed( 'delete' ) && !$wgUser->isBlocked() ) { $this->mAllowed = true; } else { $this->mAllowed = false;