For MediaWiki (recent comments | status changes | tags | authors | states | release notes | statistics)
Index: trunk/phase3/includes/User.php =================================================================== --- trunk/phase3/includes/User.php (revision 10002) +++ trunk/phase3/includes/User.php (revision 10003) @@ -512,6 +512,20 @@ $this->getBlockedStatus( $bFromSlave ); return $this->mBlockedby !== 0; } + + /** + * Check if user is blocked from editing a particular article + */ + function isBlockedFrom( $title, $bFromSlave = false ) { + global $wgBlockAllowsUTEdit; + if ( $wgBlockAllowsUTEdit && $title->getText() === $this->getName() && + $title->getNamespace() == NS_USER_TALK ) + { + return false; + } else { + return $this->isBlocked( $bFromSlave ); + } + } /** * Get name of blocker Index: trunk/phase3/includes/EditPage.php =================================================================== --- trunk/phase3/includes/EditPage.php (revision 10002) +++ trunk/phase3/includes/EditPage.php (revision 10003) @@ -149,7 +149,7 @@ $wgOut->readOnlyPage( $this->mArticle->getContent( true ), true ); return; } - if ( !$this->preview && !$this->diff && $wgUser->isBlocked( !$this->save ) ) { + if ( !$this->preview && !$this->diff && $wgUser->isBlockedFrom( $this->mTitle, !$this->save ) ) { # When previewing, don't check blocked state - will get caught at save time. # Also, check when starting edition is done against slave to improve performance. $this->blockedIPpage(); @@ -348,7 +348,7 @@ # Error messages or other handling should be performed by the filter function return; } - if ( $wgUser->isBlocked( false ) ) { + if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) { # Check block state against master, thus 'false'. $this->blockedIPpage(); return; Index: trunk/phase3/includes/DefaultSettings.php =================================================================== --- trunk/phase3/includes/DefaultSettings.php (revision 10002) +++ trunk/phase3/includes/DefaultSettings.php (revision 10003) @@ -673,6 +673,7 @@ $wgSysopRangeBans = true; # Allow sysops to ban IP ranges $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire +$wgBlockAllowsUTEdit = false; # Blocks allow users to edit their own user talk page /** * Permission keys given to users in each group.