| Index: trunk/phase3/includes/User.php |
| — | — | @@ -512,6 +512,20 @@ |
| 513 | 513 | $this->getBlockedStatus( $bFromSlave ); |
| 514 | 514 | return $this->mBlockedby !== 0; |
| 515 | 515 | } |
| | 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 | + } |
| 516 | 530 | |
| 517 | 531 | /** |
| 518 | 532 | * Get name of blocker |
| Index: trunk/phase3/includes/EditPage.php |
| — | — | @@ -149,7 +149,7 @@ |
| 150 | 150 | $wgOut->readOnlyPage( $this->mArticle->getContent( true ), true ); |
| 151 | 151 | return; |
| 152 | 152 | } |
| 153 | | - if ( !$this->preview && !$this->diff && $wgUser->isBlocked( !$this->save ) ) { |
| | 153 | + if ( !$this->preview && !$this->diff && $wgUser->isBlockedFrom( $this->mTitle, !$this->save ) ) { |
| 154 | 154 | # When previewing, don't check blocked state - will get caught at save time. |
| 155 | 155 | # Also, check when starting edition is done against slave to improve performance. |
| 156 | 156 | $this->blockedIPpage(); |
| — | — | @@ -348,7 +348,7 @@ |
| 349 | 349 | # Error messages or other handling should be performed by the filter function |
| 350 | 350 | return; |
| 351 | 351 | } |
| 352 | | - if ( $wgUser->isBlocked( false ) ) { |
| | 352 | + if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) { |
| 353 | 353 | # Check block state against master, thus 'false'. |
| 354 | 354 | $this->blockedIPpage(); |
| 355 | 355 | return; |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -673,6 +673,7 @@ |
| 674 | 674 | $wgSysopRangeBans = true; # Allow sysops to ban IP ranges |
| 675 | 675 | |
| 676 | 676 | $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire |
| | 677 | +$wgBlockAllowsUTEdit = false; # Blocks allow users to edit their own user talk page |
| 677 | 678 | |
| 678 | 679 | /** |
| 679 | 680 | * Permission keys given to users in each group. |