Index: trunk/phase3/maintenance/archives/patch-ipb_allow_usertalk.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +-- Adding ipb_allow_usertalk for blocks
|
| 3 | +ALTER TABLE /*$wgDBprefix*/ipblocks
|
| 4 | + ADD ipb_allow_usertalk bool NOT NULL default 0;
|
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -146,7 +146,8 @@ |
147 | 147 | |
148 | 148 | // 1.14 |
149 | 149 | array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ), |
150 | | - array( 'do_active_users_init' ) |
| 150 | + array( 'do_active_users_init' ), |
| 151 | + array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' ) |
151 | 152 | ); |
152 | 153 | |
153 | 154 | |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -678,6 +678,9 @@ |
679 | 679 | -- Block prevents user from accessing Special:Emailuser |
680 | 680 | ipb_block_email bool NOT NULL default 0, |
681 | 681 | |
| 682 | + -- Block allows user to edit their own talk page |
| 683 | + ipb_allow_usertalk bool NOT NULL default 0, |
| 684 | + |
682 | 685 | PRIMARY KEY ipb_id (ipb_id), |
683 | 686 | |
684 | 687 | -- Unique index to support "user already blocked" messages |
Index: trunk/phase3/CREDITS |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | * Hojjat |
22 | 22 | * Jon Harald Søby |
23 | 23 | * Leon Weber |
| 24 | +* Matt Johnston |
24 | 25 | * Meno25 |
25 | 26 | * MinuteElectron |
26 | 27 | * Mohamed Magdy |
Index: trunk/phase3/includes/User.php |
— | — | @@ -1034,6 +1034,7 @@ |
1035 | 1035 | |
1036 | 1036 | $this->mBlockedby = 0; |
1037 | 1037 | $this->mHideName = 0; |
| 1038 | + $this->mAllowUsertalk = 0; |
1038 | 1039 | $ip = wfGetIP(); |
1039 | 1040 | |
1040 | 1041 | if ($this->isAllowed( 'ipblock-exempt' ) ) { |
— | — | @@ -1049,6 +1050,7 @@ |
1050 | 1051 | $this->mBlockedby = $this->mBlock->mBy; |
1051 | 1052 | $this->mBlockreason = $this->mBlock->mReason; |
1052 | 1053 | $this->mHideName = $this->mBlock->mHideName; |
| 1054 | + $this->mAllowUsertalk = $this->mBlock->mAllowUsertalk; |
1053 | 1055 | if ( $this->isLoggedIn() ) { |
1054 | 1056 | $this->spreadBlock(); |
1055 | 1057 | } |
— | — | @@ -1264,7 +1266,7 @@ |
1265 | 1267 | wfDebug( __METHOD__.": asking isBlocked()\n" ); |
1266 | 1268 | $blocked = $this->isBlocked( $bFromSlave ); |
1267 | 1269 | # If a user's name is suppressed, they cannot make edits anywhere |
1268 | | - if ( !$this->mHideName && $wgBlockAllowsUTEdit && $title->getText() === $this->getName() && |
| 1270 | + if ( !$this->mHideName && $this->mAllowUsertalk && $title->getText() === $this->getName() && |
1269 | 1271 | $title->getNamespace() == NS_USER_TALK ) { |
1270 | 1272 | $blocked = false; |
1271 | 1273 | wfDebug( __METHOD__.": self-talk page, ignoring any blocks\n" ); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1069,7 +1069,7 @@ |
1070 | 1070 | $wgSysopUserBans = true; # Allow sysops to ban logged-in users |
1071 | 1071 | $wgSysopRangeBans = true; # Allow sysops to ban IP ranges |
1072 | 1072 | $wgAutoblockExpiry = 86400; # Number of seconds before autoblock entries expire |
1073 | | -$wgBlockAllowsUTEdit = false; # Blocks allow users to edit their own user talk page |
| 1073 | +$wgBlockAllowsUTEdit = false; # Default setting for option on block form to allow self talkpage editing whilst blocked |
1074 | 1074 | $wgSysopEmailBans = true; # Allow sysops to ban users from accessing Emailuser |
1075 | 1075 | |
1076 | 1076 | # Pages anonymous user may see as an array, e.g.: |
Index: trunk/phase3/includes/specials/SpecialBlockip.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | # var $BlockEmail; |
49 | 49 | |
50 | 50 | function IPBlockForm( $par ) { |
51 | | - global $wgRequest, $wgUser; |
| 51 | + global $wgRequest, $wgUser, $wgBlockAllowsUTEdit; |
52 | 52 | |
53 | 53 | $this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip', $par ) ); |
54 | 54 | $this->BlockAddress = strtr( $this->BlockAddress, '_', ' ' ); |
— | — | @@ -66,6 +66,11 @@ |
67 | 67 | $this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false ); |
68 | 68 | # Re-check user's rights to hide names, very serious, defaults to 0 |
69 | 69 | $this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0; |
| 70 | + if($wgRequest->wasPosted()){ |
| 71 | + $this->BlockAllowUsertalk = $wgRequest->getBool( 'wpAllowUsertalk', false ); |
| 72 | + }else{ |
| 73 | + $this->BlockAllowUsertalk = $wgBlockAllowsUTEdit; |
| 74 | + } |
70 | 75 | } |
71 | 76 | |
72 | 77 | function showForm( $err ) { |
— | — | @@ -238,6 +243,14 @@ |
239 | 244 | 'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser, |
240 | 245 | array( 'tabindex' => '11' ) ) . " |
241 | 246 | </td> |
| 247 | + </tr> |
| 248 | + <tr id='wpAllowUsertalkRow'> |
| 249 | + <td> </td> |
| 250 | + <td class='mw-input'>" . |
| 251 | + Xml::checkLabel( wfMsg( 'ipballowusertalk' ), |
| 252 | + 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk, |
| 253 | + array( 'tabindex' => '12' ) ) . " |
| 254 | + </td> |
242 | 255 | </tr>" |
243 | 256 | ); |
244 | 257 | |
— | — | @@ -246,7 +259,7 @@ |
247 | 260 | <td style='padding-top: 1em'> </td> |
248 | 261 | <td class='mw-submit' style='padding-top: 1em'>" . |
249 | 262 | Xml::submitButton( wfMsg( 'ipbsubmit' ), |
250 | | - array( 'name' => 'wpBlock', 'tabindex' => '12', 'accesskey' => 's' ) ) . " |
| 263 | + array( 'name' => 'wpBlock', 'tabindex' => '13', 'accesskey' => 's' ) ) . " |
251 | 264 | </td> |
252 | 265 | </tr>" . |
253 | 266 | Xml::closeElement( 'table' ) . |
— | — | @@ -361,7 +374,7 @@ |
362 | 375 | $block = new Block( $this->BlockAddress, $userId, $wgUser->getId(), |
363 | 376 | $reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly, |
364 | 377 | $this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName, |
365 | | - $this->BlockEmail ); |
| 378 | + $this->BlockEmail, $this->BlockAllowUsertalk ); |
366 | 379 | |
367 | 380 | if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) { |
368 | 381 | |
— | — | @@ -452,6 +465,8 @@ |
453 | 466 | $flags[] = 'noautoblock'; |
454 | 467 | if ( $this->BlockEmail ) |
455 | 468 | $flags[] = 'noemail'; |
| 469 | + if ( !$this->BlockAllowUsertalk ) |
| 470 | + $flags[] = 'nousertalk'; |
456 | 471 | return implode( ',', $flags ); |
457 | 472 | } |
458 | 473 | |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | class Block { |
18 | 18 | /* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry, |
19 | 19 | $mRangeStart, $mRangeEnd, $mAnonOnly, $mEnableAutoblock, $mHideName, |
20 | | - $mBlockEmail, $mByName, $mAngryAutoblock; |
| 20 | + $mBlockEmail, $mByName, $mAngryAutoblock, $mAllowUsertalk; |
21 | 21 | /* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster; |
22 | 22 | |
23 | 23 | const EB_KEEP_EXPIRED = 1; |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | function __construct( $address = '', $user = 0, $by = 0, $reason = '', |
28 | 28 | $timestamp = '' , $auto = 0, $expiry = '', $anonOnly = 0, $createAccount = 0, $enableAutoblock = 0, |
29 | | - $hideName = 0, $blockEmail = 0 ) |
| 29 | + $hideName = 0, $blockEmail = 0, $allowUsertalk = 0 ) |
30 | 30 | { |
31 | 31 | $this->mId = 0; |
32 | 32 | # Expand valid IPv6 addresses |
— | — | @@ -42,6 +42,7 @@ |
43 | 43 | $this->mEnableAutoblock = $enableAutoblock; |
44 | 44 | $this->mHideName = $hideName; |
45 | 45 | $this->mBlockEmail = $blockEmail; |
| 46 | + $this->mAllowUsertalk = $allowUsertalk; |
46 | 47 | $this->mForUpdate = false; |
47 | 48 | $this->mFromMaster = false; |
48 | 49 | $this->mByName = false; |
— | — | @@ -95,7 +96,7 @@ |
96 | 97 | $this->mAddress = $this->mReason = $this->mTimestamp = ''; |
97 | 98 | $this->mId = $this->mAnonOnly = $this->mCreateAccount = |
98 | 99 | $this->mEnableAutoblock = $this->mAuto = $this->mUser = |
99 | | - $this->mBy = $this->mHideName = $this->mBlockEmail = 0; |
| 100 | + $this->mBy = $this->mHideName = $this->mBlockEmail = $this->mAllowUsertalk = 0; |
100 | 101 | $this->mByName = false; |
101 | 102 | } |
102 | 103 | |
— | — | @@ -303,6 +304,7 @@ |
304 | 305 | $this->mCreateAccount = $row->ipb_create_account; |
305 | 306 | $this->mEnableAutoblock = $row->ipb_enable_autoblock; |
306 | 307 | $this->mBlockEmail = $row->ipb_block_email; |
| 308 | + $this->mAllowUsertalk = $row->ipb_allow_usertalk; |
307 | 309 | $this->mHideName = $row->ipb_deleted; |
308 | 310 | $this->mId = $row->ipb_id; |
309 | 311 | $this->mExpiry = self::decodeExpiry( $row->ipb_expiry ); |
— | — | @@ -437,7 +439,8 @@ |
438 | 440 | 'ipb_range_start' => $this->mRangeStart, |
439 | 441 | 'ipb_range_end' => $this->mRangeEnd, |
440 | 442 | 'ipb_deleted' => $this->mHideName, |
441 | | - 'ipb_block_email' => $this->mBlockEmail |
| 443 | + 'ipb_block_email' => $this->mBlockEmail, |
| 444 | + 'ipb_allow_usertalk' => $this->mAllowUsertalk |
442 | 445 | ), 'Block::insert', array( 'IGNORE' ) |
443 | 446 | ); |
444 | 447 | $affected = $dbw->affectedRows(); |
— | — | @@ -473,7 +476,8 @@ |
474 | 477 | 'ipb_range_start' => $this->mRangeStart, |
475 | 478 | 'ipb_range_end' => $this->mRangeEnd, |
476 | 479 | 'ipb_deleted' => $this->mHideName, |
477 | | - 'ipb_block_email' => $this->mBlockEmail ), |
| 480 | + 'ipb_block_email' => $this->mBlockEmail, |
| 481 | + 'ipb_allow_usertalk' => $this->mAllowUsertalk ), |
478 | 482 | array( 'ipb_id' => $this->mId ), |
479 | 483 | 'Block::update' ); |
480 | 484 | |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2501,6 +2501,7 @@ |
2502 | 2502 | 'ipbotherreason' => 'Other/additional reason:', |
2503 | 2503 | 'ipbhidename' => 'Hide username from the block log, active block list and user list', |
2504 | 2504 | 'ipbwatchuser' => "Watch this user's user and talk pages", |
| 2505 | +'ipballowusertalk' => "Allow this user to edit their own talk page while blocked", |
2505 | 2506 | 'badipaddress' => 'Invalid IP address', |
2506 | 2507 | 'blockipsuccesssub' => 'Block succeeded', |
2507 | 2508 | 'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] has been blocked.<br /> |
— | — | @@ -2545,6 +2546,7 @@ |
2546 | 2547 | 'block-log-flags-nocreate' => 'account creation disabled', |
2547 | 2548 | 'block-log-flags-noautoblock' => 'autoblock disabled', |
2548 | 2549 | 'block-log-flags-noemail' => 'e-mail blocked', |
| 2550 | +'block-log-flags-nousertalk' => 'cannot edit own talk page', |
2549 | 2551 | 'block-log-flags-angry-autoblock' => 'enhanced autoblock enabled', |
2550 | 2552 | 'range_block_disabled' => 'The sysop ability to create range blocks is disabled.', |
2551 | 2553 | 'ipb_expiry_invalid' => 'Expiry time invalid.', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -138,6 +138,7 @@ |
139 | 139 | image. |
140 | 140 | * (bug 12650) It is now possible to set different expiration times for different |
141 | 141 | restriction types on the protection form. |
| 142 | +* (bug 8440) Allow preventing blocked users from editing their talk pages |
142 | 143 | |
143 | 144 | === Bug fixes in 1.14 === |
144 | 145 | |