MediaWiki  1.29.2
UserRightsProxy Class Reference

Cut-down copy of User interface for local-interwiki-database user rights manipulation. More...

Public Member Functions

 addGroup ( $group, $expiry=null)
 Replaces User::addGroup() More...
 
 getDBName ()
 Accessor for $this->database. More...
 
 getGroupMemberships ()
 Replaces User::getGroupMemberships() More...
 
 getGroups ()
 Replaces User::getUserGroups() More...
 
 getId ()
 
 getName ()
 Same as User::getName() More...
 
 getUserPage ()
 Same as User::getUserPage() More...
 
 invalidateCache ()
 Replaces User::touchUser() More...
 
 isAnon ()
 
 removeGroup ( $group)
 Replaces User::removeGroup() More...
 
 saveSettings ()
 
 setOption ( $option, $value)
 Replaces User::setOption() More...
 

Static Public Member Functions

static getDB ( $database, $ignoreInvalidDB=false)
 Open a database connection to work on for the requested user. More...
 
static newFromId ( $database, $id, $ignoreInvalidDB=false)
 Factory function; get a remote user entry by ID number. More...
 
static newFromName ( $database, $name, $ignoreInvalidDB=false)
 Factory function; get a remote user entry by name. More...
 
static validDatabase ( $database)
 Confirm the selected database name is a valid local interwiki database name. More...
 
static whoIs ( $database, $id, $ignoreInvalidDB=false)
 Same as User::whoIs() More...
 

Private Member Functions

 __construct ( $db, $database, $name, $id)
 Constructor. More...
 

Static Private Member Functions

static newFromLookup ( $database, $field, $value, $ignoreInvalidDB=false)
 

Detailed Description

Cut-down copy of User interface for local-interwiki-database user rights manipulation.

Definition at line 29 of file UserRightsProxy.php.

Constructor & Destructor Documentation

◆ __construct()

UserRightsProxy::__construct (   $db,
  $database,
  $name,
  $id 
)
private

Constructor.

See also
newFromId()
newFromName()
Parameters
IDatabase$dbDb connection
string$databaseDatabase name
string$nameUser name
int$idUser ID

Definition at line 41 of file UserRightsProxy.php.

References $name, database, and name.

Member Function Documentation

◆ addGroup()

UserRightsProxy::addGroup (   $group,
  $expiry = null 
)

Replaces User::addGroup()

Parameters
string$group
string | null$expiry
Returns
bool

Definition at line 223 of file UserRightsProxy.php.

References wfTimestamp().

◆ getDB()

static UserRightsProxy::getDB (   $database,
  $ignoreInvalidDB = false 
)
static

Open a database connection to work on for the requested user.

This may be a new connection to another database for remote users.

Parameters
string$database
bool$ignoreInvalidDBIf true, don't check if $database is in $wgLocalDatabases
Returns
IDatabase|null If invalid selection

Definition at line 153 of file UserRightsProxy.php.

References $wgDBname, DB_MASTER, global, and wfGetDB().

Referenced by newFromLookup().

◆ getDBName()

UserRightsProxy::getDBName ( )

Accessor for $this->database.

Returns
string Database name

Definition at line 54 of file UserRightsProxy.php.

◆ getGroupMemberships()

UserRightsProxy::getGroupMemberships ( )

Replaces User::getGroupMemberships()

Returns
array
Since
1.29

Definition at line 212 of file UserRightsProxy.php.

References UserGroupMembership\getMembershipsForUser().

◆ getGroups()

UserRightsProxy::getGroups ( )

Replaces User::getUserGroups()

Returns
array

Definition at line 202 of file UserRightsProxy.php.

◆ getId()

UserRightsProxy::getId ( )
Returns
int

Definition at line 169 of file UserRightsProxy.php.

Referenced by isAnon().

◆ getName()

UserRightsProxy::getName ( )

Same as User::getName()

Returns
string

Definition at line 185 of file UserRightsProxy.php.

References name.

Referenced by getUserPage().

◆ getUserPage()

UserRightsProxy::getUserPage ( )

Same as User::getUserPage()

Returns
Title

Definition at line 194 of file UserRightsProxy.php.

References getName(), Title\makeTitle(), and NS_USER.

◆ invalidateCache()

UserRightsProxy::invalidateCache ( )

Replaces User::touchUser()

Definition at line 274 of file UserRightsProxy.php.

References User\purge(), and use.

Referenced by saveSettings().

◆ isAnon()

UserRightsProxy::isAnon ( )
Returns
bool

Definition at line 176 of file UserRightsProxy.php.

References getId().

◆ newFromId()

static UserRightsProxy::newFromId (   $database,
  $id,
  $ignoreInvalidDB = false 
)
static

Factory function; get a remote user entry by ID number.

Parameters
string$databaseDatabase name
int$idUser ID
bool$ignoreInvalidDBIf true, don't check if $database is in $wgLocalDatabases
Returns
UserRightsProxy|null If doesn't exist

Definition at line 94 of file UserRightsProxy.php.

References newFromLookup().

Referenced by whoIs().

◆ newFromLookup()

static UserRightsProxy::newFromLookup (   $database,
  $field,
  $value,
  $ignoreInvalidDB = false 
)
staticprivate
Parameters
string$database
string$field
string$value
bool$ignoreInvalidDB
Returns
null|UserRightsProxy

Definition at line 117 of file UserRightsProxy.php.

References $value, $wgSharedDB, $wgSharedTables, getDB(), and global.

Referenced by newFromId(), and newFromName().

◆ newFromName()

static UserRightsProxy::newFromName (   $database,
  $name,
  $ignoreInvalidDB = false 
)
static

Factory function; get a remote user entry by name.

Parameters
string$databaseDatabase name
string$nameUser name
bool$ignoreInvalidDBIf true, don't check if $database is in $wgLocalDatabases
Returns
UserRightsProxy|null If doesn't exist

Definition at line 106 of file UserRightsProxy.php.

References $name, and newFromLookup().

Referenced by UserrightsPage\fetchUser().

◆ removeGroup()

UserRightsProxy::removeGroup (   $group)

Replaces User::removeGroup()

Parameters
string$group
Returns
bool

Definition at line 238 of file UserRightsProxy.php.

References UserGroupMembership\getMembership().

◆ saveSettings()

UserRightsProxy::saveSettings ( )

Definition at line 255 of file UserRightsProxy.php.

References $value, as, and invalidateCache().

◆ setOption()

UserRightsProxy::setOption (   $option,
  $value 
)

Replaces User::setOption()

Parameters
string$option
mixed$value

Definition at line 251 of file UserRightsProxy.php.

References $value.

◆ validDatabase()

static UserRightsProxy::validDatabase (   $database)
static

Confirm the selected database name is a valid local interwiki database name.

Parameters
string$databaseDatabase name
Returns
bool

Definition at line 64 of file UserRightsProxy.php.

References $wgLocalDatabases, and global.

Referenced by UserrightsPage\fetchUser().

◆ whoIs()

static UserRightsProxy::whoIs (   $database,
  $id,
  $ignoreInvalidDB = false 
)
static

Same as User::whoIs()

Parameters
string$databaseDatabase name
int$idUser ID
bool$ignoreInvalidDBIf true, don't check if $database is in $wgLocalDatabases
Returns
string User name or false if the user doesn't exist

Definition at line 77 of file UserRightsProxy.php.

References $user, and newFromId().

Referenced by UserrightsPage\fetchUser().


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