Prevent blocked users from using delete and undelete
authorRob Church <robchurch@users.mediawiki.org>
Fri, 6 Jan 2006 23:21:38 +0000 (23:21 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 6 Jan 2006 23:21:38 +0000 (23:21 +0000)
RELEASE-NOTES
includes/Article.php
includes/SpecialUndelete.php

index 27fa13e..4112e37 100644 (file)
@@ -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 ===
index c5ef0ce..077785c 100644 (file)
@@ -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;
index 8d3f858..657b4b5 100644 (file)
@@ -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;