Gerrit Patch Uploader has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/133990

Change subject: Show block notice on contribs for range-blocked IP
......................................................................

Show block notice on contribs for range-blocked IP

This also slightly changes the way User::getBlockedStatus works.

Bug: 20790
Change-Id: I83f15dfb852e1bf0e624633ca427d95dbec46631
---
M includes/User.php
M includes/specials/SpecialContributions.php
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/133990/1

diff --git a/includes/User.php b/includes/User.php
index 6578341..d545046 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -1485,6 +1485,8 @@
                # know which IP address they're actually coming from
                if ( !$this->isAllowed( 'ipblock-exempt' ) && $this->getID() == 
$wgUser->getID() ) {
                        $ip = $this->getRequest()->getIP();
+               } elseif ( $this->isAnon() ) {
+                       $ip = $this->getName();
                } else {
                        $ip = null;
                }
diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index 0571d0d..bc9c978 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -269,6 +269,10 @@
                        // Do not expose the autoblocks, since that may lead to 
a leak of accounts' IPs,
                        // and also this will display a totally irrelevant log 
entry as a current block.
                        if ( $userObj->isBlocked() && 
$userObj->getBlock()->getType() != Block::TYPE_AUTO ) {
+                               $block = $userObj->getBlock();
+                               if ( $block->getType() == Block::TYPE_RANGE ) {
+                                       $nt = 'User:' . $block->getTarget();
+                               }
                                $out = $this->getOutput(); // showLogExtract() 
wants first parameter by reference
                                LogEventsList::showLogExtract(
                                        $out,

-- 
To view, visit https://gerrit.wikimedia.org/r/133990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83f15dfb852e1bf0e624633ca427d95dbec46631
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gerrit Patch Uploader <gerritpatchuploa...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to