From 68fe332eec562baca37334d9eae7b7b8929fb332 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Tue, 19 Apr 2016 10:25:43 -0400 Subject: [PATCH] Make blocks log users out if $wgBlockDisablesLogin Issue originally reported by Multichill Bug: T129738 Change-Id: Iddc58e504297c60f6d3ca99f21034fe7c5cf9801 --- includes/Block.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/Block.php b/includes/Block.php index a3d3691..0807ed2 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -402,6 +402,7 @@ class Block { * ('id' => block ID, 'autoIds' => array of autoblock IDs) */ public function insert( $dbw = null ) { + global $wgBlockDisablesLogin; wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" ); if ( $dbw === null ) { @@ -424,6 +425,11 @@ class Block { $this->mId = $dbw->insertId(); if ( $affected ) { + if ( $wgBlockDisablesLogin && $this->target instanceof User ) { + // Change user login token to force them to be logged out. + $this->target->setToken(); + $this->target->saveSettings(); + } $auto_ipd_ids = $this->doRetroactiveAutoblock(); return array( 'id' => $this->mId, 'autoIds' => $auto_ipd_ids ); } -- 2.0.1