mediawiki-extensions-AbuseF.../includes/Variables
Dreamy Jazz 85022190e5 Add user_type variable
Why:
* An AbuseFilter variable is needed that allows filters to determine
  what type the current user is. That is, whether the user is an
  IP address, temporary account, named user or external user.
* Currently filters implement this by inspecting the value in
  the 'user_name' variable, but this is likely to break when
  temporary accounts are enabled as IPs would be hidden.
* Giving a dedicated variable that indicates the type of the user
  allows filters to work out this information without having to
  know the specific username of the user before performing the
  check.

What:
* Add the 'user_type' variable which is lazily computed. It can have
  the value 'named', 'temp', 'ip' or 'external' depending on the
  type of the user. If the user does not match any of these, then
  the value is 'unknown'.
* Replace call to deprecated User::newFromIdentity with a use of the
  UserFactory service that is dependency injected.
* Add and update tests to ensure consistent test coverage.

Bug: T357615
Change-Id: Ifffa891879e7e49d2430a0330116b34c5a03049d
2024-03-07 10:38:25 +00:00
..
LazyLoadedVariable.php build: Updating dependencies 2021-07-21 18:51:18 +00:00
LazyVariableComputer.php Add user_type variable 2024-03-07 10:38:25 +00:00
UnsetVariableException.php
VariableHolder.php Re-add BC alias for the VariableHolder class 2023-03-13 13:46:09 +01:00
VariablesBlobStore.php build: Updating dependencies 2021-07-21 18:51:18 +00:00
VariablesFormatter.php build: Upgrade mediawiki/mediawiki-phan-config to 0.13.0 2024-02-02 16:24:51 +00:00
VariablesManager.php Retrieve external links from PreparedUpdate 2023-06-13 14:30:06 +02:00