MediaWiki  1.33.0
RevisionDeleteUser Class Reference

Backend functions for suppressing and unsuppressing all references to a given user, used when blocking with HideUser enabled. More...

Static Public Member Functions

static suppressUserName ( $name, $userId, IDatabase $dbw=null)
 
static unsuppressUserName ( $name, $userId, IDatabase $dbw=null)
 

Static Private Member Functions

static buildSetBitDeletedField ( $field, $op, $value, IDatabase $dbw)
 
static setUsernameBitfields ( $name, $userId, $op, IDatabase $dbw=null)
 Update *_deleted bitfields in various tables to hide or unhide usernames. More...
 

Detailed Description

Backend functions for suppressing and unsuppressing all references to a given user, used when blocking with HideUser enabled.

This was spun out of SpecialBlockip.php in 1.18; at some point it needs to be rewritten to either use RevisionDelete abstraction, or at least schema abstraction.

Definition at line 34 of file RevisionDeleteUser.php.

Member Function Documentation

◆ buildSetBitDeletedField()

static RevisionDeleteUser::buildSetBitDeletedField (   $field,
  $op,
  $value,
IDatabase  $dbw 
)
staticprivate

◆ setUsernameBitfields()

static RevisionDeleteUser::setUsernameBitfields (   $name,
  $userId,
  $op,
IDatabase  $dbw = null 
)
staticprivate

Update *_deleted bitfields in various tables to hide or unhide usernames.

Parameters
string$nameUsername
int$userIdUser id
string$opOperator '|' or '&'
null | IDatabase$dbwIf you happen to have one lying around
Returns
bool True on success, false on failure (e.g. invalid user ID)

Definition at line 45 of file RevisionDeleteUser.php.

References $name, $wgActorTableSchemaMigrationStage, DB_MASTER, LogPage\DELETED_ACTION, Revision\DELETED_RESTRICTED, Revision\DELETED_USER, Title\makeTitleSafe(), NS_USER, SCHEMA_COMPAT_WRITE_NEW, SCHEMA_COMPAT_WRITE_OLD, and wfGetDB().

Referenced by suppressUserName(), and unsuppressUserName().

◆ suppressUserName()

static RevisionDeleteUser::suppressUserName (   $name,
  $userId,
IDatabase  $dbw = null 
)
static
Parameters
string$nameUser name
int$userIdBoth user name and ID must be provided
IDatabase | null$dbwIf you happen to have one lying around
Returns
bool True on success, false on failure (e.g. invalid user ID)

Definition at line 210 of file RevisionDeleteUser.php.

References $name, and setUsernameBitfields().

Referenced by SpecialBlock\processForm().

◆ unsuppressUserName()

static RevisionDeleteUser::unsuppressUserName (   $name,
  $userId,
IDatabase  $dbw = null 
)
static
Parameters
string$nameUser name
int$userIdBoth user name and ID must be provided
IDatabase | null$dbwIf you happen to have one lying around
Returns
bool True on success, false on failure (e.g. invalid user ID)

Definition at line 220 of file RevisionDeleteUser.php.

References $name, and setUsernameBitfields().

Referenced by SpecialBlock\processForm(), and SpecialUnblock\processUnblock().


The documentation for this class was generated from the following file: