Page MenuHomePhabricator

Update CheckUser extension to work with temporary accounts
Open, Needs TriagePublic

Description

Refactor the code to also check for a temporary user. This way, the CheckUser extension can still store and display events that are made by IPs when temporary accounts are not used.

See code snippet below :

src/CheckUser/Pagers/CheckUserGetEditsPager.php
			);
		} else {
			if ( !IPUtils::isIPAddress( $user ) && !$user->isRegistered() ) {
				$templateParams['userLinkClass'] = 'mw-checkuser-nonexistent-user';
			}


src/CheckUser/Pagers/CheckUserGetUsersPager.php
		// Load user object
		$user = new UserIdentityValue( $this->userSets['ids'][$user_text], $user_text );
		$userNonExistent = !IPUtils::isIPAddress( $user ) && !$user->isRegistered();
		if ( $userNonExistent ) {
			$templateParams['userLinkClass'] = 'mw-checkuser-nonexistent-user';

Event Timeline

Cyndymediawiksim renamed this task from Update check for IP address to check if the user is a temporary account. to Avoid looking for the IP address in the user name, as it will no longer be found. .May 17 2023, 1:44 PM
Cyndymediawiksim updated the task description. (Show Details)

Even when temporary accounts are enabled, CheckUser will still store events that are made by IPs. For example failed login attempts when the user is not using a temporary account would cause a log entry under an IP address visible only in CheckUser. Furthermore, non-WMF wikis could not be using temporary accounts.

As such, this task shouldn't be avoiding looking for an IP in the username but instead ensuring it works with temporary accounts.

Cyndymediawiksim renamed this task from Avoid looking for the IP address in the user name, as it will no longer be found. to Update CheckUser extension to work with temporary accounts.May 22 2023, 10:58 AM
Cyndymediawiksim updated the task description. (Show Details)