Page MenuHomePhabricator

Update Linker::userLink to allow identification of temporary account usernames and provide some context
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

For T325238, we want to allow privileged users to reveal the IP address used by a temporary account, ideally wherever a temporary account name is shown in the UI.

Temporary accounts may use multiple IP addresses over time, and in some places we only want to show the most relevant IP address (e.g. in a recent changes line, the IP that was used when that change was made).

Most instances of usernames being displayed on special pages etc are created by Linker::userLink.

What needs to be done

Linker::userLink should add a class for temporary user names, e.g. mw-tempuserlink, so that occurrences can be found easliy.
Linker::userLink should allow setting the HTML data attributes so that some context can be stored, which can be used to look up the most relevant IP address for a temporary account user (e.g. revision ID for history pages - T326392: IP Address Reveal on History page).

Event Timeline

Tchanders set the point value for this task to 3.

Change 877199 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] Linker: Add a class for temporary account user name links

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

Change 877199 merged by jenkins-bot:

[mediawiki/core@master] Linker: Add a class for temporary account user name links

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

@Tchanders On Special:AbuseLog, temporary users have the mw-anonuserlink class rather than the mw-tempuserlink. Is this expected? Perhaps it is calling Linker::userLink with $userId = 0?

(There are examples on https://de.wikipedia.beta.wmflabs.org/wiki/Spezial:Missbrauchsfilter-Logbuch)

@Tchanders On Special:AbuseLog, temporary users have the mw-anonuserlink class rather than the mw-tempuserlink. Is this expected? Perhaps it is calling Linker::userLink with $userId = 0?

(There are examples on https://de.wikipedia.beta.wmflabs.org/wiki/Spezial:Missbrauchsfilter-Logbuch)

@dom_walden I'm not sure. I followed your link and found the anon classes on de beta, but locally, they do have the correct class:

image.png (501×857 px, 118 KB)

Filed as T328311: Special:AbuseLog is missing the `mw-tempuserlink` class from temporary account user links

Thanks. We can follow this issue up there.

I have looked at user links on various pages to check they have the new mw-tempuserlink class, including Special:RecentChanges, Special:Log, revision history, credits, diff pages, Special:Watchlist.

I haven't tested every place where user links appear. Possibly there will be more cases like Special:AbuseLog, but they will become apparent over time, and I cannot imagine the consequences would be that bad.