Huji has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/380420 )
Change subject: CheckUser "contributions" link should be a red link for
non-existent accounts
..
CheckUser "contributions" link should be a red link for non-existent accounts
In Special:CheckUser, when a user had tried create and account while this was
prevented by abusefilter, his or her "contributions" link was still blue
instead of a red link (as if that user actually exists). The patch add takes
advantage of the existing yet unsued css class .mw-anonuserlink, and turn the
link to red.
Bug: T170507
Change-Id: I669affa176f6c5b0dbf61ac3ca4e77a4fb6eb3e5
---
M i18n/en.json
M i18n/qqq.json
M specials/SpecialCheckUser.php
3 files changed, 50 insertions(+), 9 deletions(-)
Approvals:
Huji: Looks good to me, approved
jenkins-bot: Verified
diff --git a/i18n/en.json b/i18n/en.json
index ce5d335..cfe7fe9 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -81,8 +81,7 @@
"checkuser-create-action": "was created",
"checkuser-email-action": "sent an email to user \"$1\"",
"checkuser-reset-action": "reset password for user \"$1\"",
- "checkuser-userlinks-ip": "([[User_talk:$1|talk]] |
[[Special:Contributions/$1|contribs]] | [[Special:Block/$1|block]] | [https://www.robtex.com/whois/$1.html WHOIS/RDNS])",
- "checkuser-userlinks": "([[User_talk:$1|talk]] |
[[Special:Contributions/$1|contribs]] | [[Special:Block/$1|block]])",
+ "checkuser-userlinks-ip": "([https://www.robtex.com/whois/$1.html WHOIS/RDNS])",
"checkuser-toollinks": "[[https://www.robtex.com/whois/$1.html WHOIS/RDNS]
·\n[https://www.robtex.com/rbls/$1.html RBLs]
·\n[http://www.dnsstuff.com/tools/tracert.ch?ip=$1 Traceroute]
·\n[https://www.ip2location.com/$1 Geolocate]
·\n[https://www.dan.me.uk/torcheck?ip=$1 Tor check]]",
"checkuser-token-fail": "Session failure. Please try again.",
"group-checkuser.css": "/* CSS placed here will affect checkuser only
*/",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a80836a..4a5a710 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -104,7 +104,6 @@
"checkuser-email-action": "Logged text when a user sends an e-mail.
Probably preceded by the name of the checkuser.\n\nParameters:\n* $1 - a salted
MD5 hash for the user an email was sent to",
"checkuser-reset-action": "Logged text when a user resets a password.
Parameters:\n* $1 - the username for which the password was reset. Can be used
for GENDER.",
"checkuser-userlinks-ip": "Links shown next to an IP address in a
CheckUser result entry. $1 - IP address\n\nSee
also:\n*{{msg-mw|Signature}}\n*{{msg-mw|Checkuser-userlinks}}",
- "checkuser-userlinks": "Links shown next to a user in a CheckUser
result entry. $1 - Name of user\n\nSee
also:\n*{{msg-mw|Signature}}\n*{{msg-mw|Checkuser-userlinks-ip}}",
"checkuser-toollinks": "{{notranslate}}\nParameters:\n* $1 - IP
address",
"checkuser-token-fail": "Error message shown when the CSRF token does
not match the current session.",
"group-checkuser.css": "{{doc-group|checkuser|css}}",
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 135d825..cee2dd2 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -1074,12 +1074,34 @@
$s .= '';
$s .= Xml::check( 'users[]', false, [ 'value'
=> $name ] ) . '';
// Load user object
- $user = User::newFromName( $name, false );
+ $usernfn = User::newFromName( $name, false );
// Add user page and tool links
- $s .= Linker::userLink( -1, $name ) . ' ';
+ if ( !IP::isIPAddress( $usernfn ) ) {
+ $idforlinknfn = -1;
+ } else {
+ $idforlinknfn = $users_ids[$name];
+ }
+ $user = User::newFromId( $users_ids[$name] );
+ $classnouser = false;
+ if ( IP::isIPAddress( $name ) !==
IP::isIPAddress( $user ) ) {
+ // User does not exist
+ $idforlink = -1;
+ $classnouser = true;
+ } else {
+ $idforlink = $users_ids[$name];
+ }
+ if ( $classnouser === true ) {
+ $s .= '';
+ } else {
+ $s .= '';
+ }
+