MediaWiki r10003 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r10002‎ | r10003 (on ViewVC)‎ | r10004 >
Date:21:40, 7 July 2005
Author:timstarling
Status:old
Tags:
Comment:
new feature: $wgBlockAllowsUTEdit
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -512,6 +512,20 @@
513513 $this->getBlockedStatus( $bFromSlave );
514514 return $this->mBlockedby !== 0;
515515 }
 516+
 517+ /**
 518+ * Check if user is blocked from editing a particular article
 519+ */
 520+ function isBlockedFrom( $title, $bFromSlave = false ) {
 521+ global $wgBlockAllowsUTEdit;
 522+ if ( $wgBlockAllowsUTEdit && $title->getText() === $this->getName() &&
 523+ $title->getNamespace() == NS_USER_TALK )
 524+ {
 525+ return false;
 526+ } else {
 527+ return $this->isBlocked( $bFromSlave );
 528+ }
 529+ }
516530
517531 /**
518532 * Get name of blocker
Index: trunk/phase3/includes/EditPage.php
@@ -149,7 +149,7 @@
150150 $wgOut->readOnlyPage( $this->mArticle->getContent( true ), true );
151151 return;
152152 }
153 - if ( !$this->preview && !$this->diff && $wgUser->isBlocked( !$this->save ) ) {
 153+ if ( !$this->preview && !$this->diff && $wgUser->isBlockedFrom( $this->mTitle, !$this->save ) ) {
154154 # When previewing, don't check blocked state - will get caught at save time.
155155 # Also, check when starting edition is done against slave to improve performance.
156156 $this->blockedIPpage();
@@ -348,7 +348,7 @@
349349 # Error messages or other handling should be performed by the filter function
350350 return;
351351 }
352 - if ( $wgUser->isBlocked( false ) ) {
 352+ if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) {
353353 # Check block state against master, thus 'false'.
354354 $this->blockedIPpage();
355355 return;
Index: trunk/phase3/includes/DefaultSettings.php
@@ -673,6 +673,7 @@
674674 $wgSysopRangeBans = true; # Allow sysops to ban IP ranges
675675
676676 $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire
 677+$wgBlockAllowsUTEdit = false; # Blocks allow users to edit their own user talk page
677678
678679 /**
679680 * Permission keys given to users in each group.

Status & tagging log

  • 01:58, 13 October 2010 ^demon (talk | contribs) changed the status of r10003 [removed: new added: old]