* Adds database field to ipblocks table, ipb_allow_usertalk, storing whether or not the user can edit their own talk page. Defaults to 0 to coincide with the default value of $wgBlockAllowsUTEdit.
* Recommended to update all current blocks to have a allow_usertalk value of whatever the current setting is
* Retasks $wgBlockAllowsUTEdit to be the default value of the field in the blocking screen - unless a sysop changes the checkbox, will use whatever that variable is set to.
* Hojjat
* Jon Harald Søby
* Leon Weber
+* Matt Johnston
* Meno25
* MinuteElectron
* Mohamed Magdy
image.
* (bug 12650) It is now possible to set different expiration times for different
restriction types on the protection form.
+* (bug 8440) Allow preventing blocked users from editing their talk pages
=== Bug fixes in 1.14 ===
class Block {
/* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry,
$mRangeStart, $mRangeEnd, $mAnonOnly, $mEnableAutoblock, $mHideName,
- $mBlockEmail, $mByName, $mAngryAutoblock;
+ $mBlockEmail, $mByName, $mAngryAutoblock, $mAllowUsertalk;
/* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster;
const EB_KEEP_EXPIRED = 1;
function __construct( $address = '', $user = 0, $by = 0, $reason = '',
$timestamp = '' , $auto = 0, $expiry = '', $anonOnly = 0, $createAccount = 0, $enableAutoblock = 0,
- $hideName = 0, $blockEmail = 0 )
+ $hideName = 0, $blockEmail = 0, $allowUsertalk = 0 )
{
$this->mId = 0;
# Expand valid IPv6 addresses
$this->mEnableAutoblock = $enableAutoblock;
$this->mHideName = $hideName;
$this->mBlockEmail = $blockEmail;
+ $this->mAllowUsertalk = $allowUsertalk;
$this->mForUpdate = false;
$this->mFromMaster = false;
$this->mByName = false;
$this->mAddress = $this->mReason = $this->mTimestamp = '';
$this->mId = $this->mAnonOnly = $this->mCreateAccount =
$this->mEnableAutoblock = $this->mAuto = $this->mUser =
- $this->mBy = $this->mHideName = $this->mBlockEmail = 0;
+ $this->mBy = $this->mHideName = $this->mBlockEmail = $this->mAllowUsertalk = 0;
$this->mByName = false;
}
$this->mCreateAccount = $row->ipb_create_account;
$this->mEnableAutoblock = $row->ipb_enable_autoblock;
$this->mBlockEmail = $row->ipb_block_email;
+ $this->mAllowUsertalk = $row->ipb_allow_usertalk;
$this->mHideName = $row->ipb_deleted;
$this->mId = $row->ipb_id;
$this->mExpiry = self::decodeExpiry( $row->ipb_expiry );
'ipb_range_start' => $this->mRangeStart,
'ipb_range_end' => $this->mRangeEnd,
'ipb_deleted' => $this->mHideName,
- 'ipb_block_email' => $this->mBlockEmail
+ 'ipb_block_email' => $this->mBlockEmail,
+ 'ipb_allow_usertalk' => $this->mAllowUsertalk
), 'Block::insert', array( 'IGNORE' )
);
$affected = $dbw->affectedRows();
'ipb_range_start' => $this->mRangeStart,
'ipb_range_end' => $this->mRangeEnd,
'ipb_deleted' => $this->mHideName,
- 'ipb_block_email' => $this->mBlockEmail ),
+ 'ipb_block_email' => $this->mBlockEmail,
+ 'ipb_allow_usertalk' => $this->mAllowUsertalk ),
array( 'ipb_id' => $this->mId ),
'Block::update' );
$wgSysopUserBans = true; # Allow sysops to ban logged-in users
$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
+$wgBlockAllowsUTEdit = false; # Default setting for option on block form to allow self talkpage editing whilst blocked
$wgSysopEmailBans = true; # Allow sysops to ban users from accessing Emailuser
# Pages anonymous user may see as an array, e.g.:
$this->mBlockedby = 0;
$this->mHideName = 0;
+ $this->mAllowUsertalk = 0;
$ip = wfGetIP();
if ($this->isAllowed( 'ipblock-exempt' ) ) {
$this->mBlockedby = $this->mBlock->mBy;
$this->mBlockreason = $this->mBlock->mReason;
$this->mHideName = $this->mBlock->mHideName;
+ $this->mAllowUsertalk = $this->mBlock->mAllowUsertalk;
if ( $this->isLoggedIn() ) {
$this->spreadBlock();
}
wfDebug( __METHOD__.": asking isBlocked()\n" );
$blocked = $this->isBlocked( $bFromSlave );
# If a user's name is suppressed, they cannot make edits anywhere
- if ( !$this->mHideName && $wgBlockAllowsUTEdit && $title->getText() === $this->getName() &&
+ if ( !$this->mHideName && $this->mAllowUsertalk && $title->getText() === $this->getName() &&
$title->getNamespace() == NS_USER_TALK ) {
$blocked = false;
wfDebug( __METHOD__.": self-talk page, ignoring any blocks\n" );
# var $BlockEmail;
function IPBlockForm( $par ) {
- global $wgRequest, $wgUser;
+ global $wgRequest, $wgUser, $wgBlockAllowsUTEdit;
$this->BlockAddress = $wgRequest->getVal( 'wpBlockAddress', $wgRequest->getVal( 'ip', $par ) );
$this->BlockAddress = strtr( $this->BlockAddress, '_', ' ' );
$this->BlockWatchUser = $wgRequest->getBool( 'wpWatchUser', false );
# Re-check user's rights to hide names, very serious, defaults to 0
$this->BlockHideName = ( $wgRequest->getBool( 'wpHideName', 0 ) && $wgUser->isAllowed( 'hideuser' ) ) ? 1 : 0;
+ if($wgRequest->wasPosted()){
+ $this->BlockAllowUsertalk = $wgRequest->getBool( 'wpAllowUsertalk', false );
+ }else{
+ $this->BlockAllowUsertalk = $wgBlockAllowsUTEdit;
+ }
}
function showForm( $err ) {
'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser,
array( 'tabindex' => '11' ) ) . "
</td>
+ </tr>
+ <tr id='wpAllowUsertalkRow'>
+ <td> </td>
+ <td class='mw-input'>" .
+ Xml::checkLabel( wfMsg( 'ipballowusertalk' ),
+ 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk,
+ array( 'tabindex' => '12' ) ) . "
+ </td>
</tr>"
);
<td style='padding-top: 1em'> </td>
<td class='mw-submit' style='padding-top: 1em'>" .
Xml::submitButton( wfMsg( 'ipbsubmit' ),
- array( 'name' => 'wpBlock', 'tabindex' => '12', 'accesskey' => 's' ) ) . "
+ array( 'name' => 'wpBlock', 'tabindex' => '13', 'accesskey' => 's' ) ) . "
</td>
</tr>" .
Xml::closeElement( 'table' ) .
$block = new Block( $this->BlockAddress, $userId, $wgUser->getId(),
$reasonstr, wfTimestampNow(), 0, $expiry, $this->BlockAnonOnly,
$this->BlockCreateAccount, $this->BlockEnableAutoblock, $this->BlockHideName,
- $this->BlockEmail );
+ $this->BlockEmail, $this->BlockAllowUsertalk );
if ( wfRunHooks('BlockIp', array(&$block, &$wgUser)) ) {
$flags[] = 'noautoblock';
if ( $this->BlockEmail )
$flags[] = 'noemail';
+ if ( !$this->BlockAllowUsertalk )
+ $flags[] = 'nousertalk';
return implode( ',', $flags );
}
'ipbotherreason' => 'Other/additional reason:',
'ipbhidename' => 'Hide username from the block log, active block list and user list',
'ipbwatchuser' => "Watch this user's user and talk pages",
+'ipballowusertalk' => "Allow this user to edit their own talk page while blocked",
'badipaddress' => 'Invalid IP address',
'blockipsuccesssub' => 'Block succeeded',
'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] has been blocked.<br />
'block-log-flags-nocreate' => 'account creation disabled',
'block-log-flags-noautoblock' => 'autoblock disabled',
'block-log-flags-noemail' => 'e-mail blocked',
+'block-log-flags-nousertalk' => 'cannot edit own talk page',
'block-log-flags-angry-autoblock' => 'enhanced autoblock enabled',
'range_block_disabled' => 'The sysop ability to create range blocks is disabled.',
'ipb_expiry_invalid' => 'Expiry time invalid.',
--- /dev/null
+-- Adding ipb_allow_usertalk for blocks\r
+ALTER TABLE /*$wgDBprefix*/ipblocks\r
+ ADD ipb_allow_usertalk bool NOT NULL default 0;\r
-- Block prevents user from accessing Special:Emailuser
ipb_block_email bool NOT NULL default 0,
+ -- Block allows user to edit their own talk page
+ ipb_allow_usertalk bool NOT NULL default 0,
+
PRIMARY KEY ipb_id (ipb_id),
-- Unique index to support "user already blocked" messages
// 1.14
array( 'add_field', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ),
- array( 'do_active_users_init' )
+ array( 'do_active_users_init' ),
+ array( 'add_field', 'ipblocks', 'ipb_allow_usertalk', 'patch-ipb_allow_usertalk.sql' )
);