MediaWiki REL1_33
UserRightsProxy Class Reference

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

Collaboration diagram for UserRightsProxy:

Public Member Functions

 addGroup ( $group, $expiry=null)
 Replaces User::addGroup()
 
 getGroupMemberships ()
 Replaces User::getGroupMemberships()
 
 getGroups ()
 Replaces User::getUserGroups()
 
 getId ()
 
 getName ()
 Same as User::getName()
 
 getUserPage ()
 Same as User::getUserPage()
 
 invalidateCache ()
 Replaces User::touchUser()
 
 isAnon ()
 
 removeGroup ( $group)
 Replaces User::removeGroup()
 
 saveSettings ()
 
 setOption ( $option, $value)
 Replaces User::setOption()
 

Static Public Member Functions

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

Private Member Functions

 __construct ( $db, $wikiId, $name, $id)
 

Static Private Member Functions

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

Private Attributes

IDatabase $db
 
int $id
 
string $name
 
array $newOptions
 
string $wikiId
 

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,
  $wikiId,
  $name,
  $id 
)
private
See also
newFromId()
newFromName()
Parameters
IDatabase$dbDb connection
string$wikiIdDatabase name
string$nameUser name
int$idUser ID

Definition at line 49 of file UserRightsProxy.php.

References $db, $id, $name, $wikiId, 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 220 of file UserRightsProxy.php.

References wfTimestamp().

◆ getDB()

static UserRightsProxy::getDB (   $wikiId,
  $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$wikiId
bool$ignoreInvalidDBIf true, don't check if $wikiId is in $wgLocalDatabases
Returns
IDatabase|null If invalid selection

Definition at line 151 of file UserRightsProxy.php.

References $wikiId, DB_MASTER, and wfGetDB().

Referenced by newFromLookup().

◆ getGroupMemberships()

UserRightsProxy::getGroupMemberships ( )

Replaces User::getGroupMemberships()

Returns
array
Since
1.29

Definition at line 209 of file UserRightsProxy.php.

◆ getGroups()

UserRightsProxy::getGroups ( )

Replaces User::getUserGroups()

Returns
array

Definition at line 199 of file UserRightsProxy.php.

◆ getId()

UserRightsProxy::getId ( )
Returns
int

Definition at line 166 of file UserRightsProxy.php.

References $id.

Referenced by isAnon().

◆ getName()

UserRightsProxy::getName ( )

Same as User::getName()

Returns
string

Definition at line 182 of file UserRightsProxy.php.

References $wikiId, and name.

Referenced by getUserPage().

◆ getUserPage()

UserRightsProxy::getUserPage ( )

Same as User::getUserPage()

Returns
Title

Definition at line 191 of file UserRightsProxy.php.

References getName(), and NS_USER.

◆ invalidateCache()

UserRightsProxy::invalidateCache ( )

Replaces User::touchUser()

Definition at line 271 of file UserRightsProxy.php.

References $id, User\purge(), and use.

Referenced by saveSettings().

◆ isAnon()

UserRightsProxy::isAnon ( )
Returns
bool

Definition at line 173 of file UserRightsProxy.php.

References getId().

◆ newFromId()

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

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

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

Definition at line 93 of file UserRightsProxy.php.

References $id, $wikiId, and newFromLookup().

Referenced by whoIs().

◆ newFromLookup()

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

Definition at line 116 of file UserRightsProxy.php.

References $db, $value, $wgSharedDB, $wgSharedTables, $wikiId, and getDB().

Referenced by newFromId(), and newFromName().

◆ newFromName()

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

Factory function; get a remote user entry by name.

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

Definition at line 105 of file UserRightsProxy.php.

References $name, $wikiId, and newFromLookup().

Referenced by UserrightsPage\fetchUser().

◆ removeGroup()

UserRightsProxy::removeGroup (   $group)

Replaces User::removeGroup()

Parameters
string$group
Returns
bool

Definition at line 235 of file UserRightsProxy.php.

◆ saveSettings()

UserRightsProxy::saveSettings ( )

Definition at line 252 of file UserRightsProxy.php.

References $id, $rows, $value, as, and invalidateCache().

◆ setOption()

UserRightsProxy::setOption (   $option,
  $value 
)

Replaces User::setOption()

Parameters
string$option
mixed$value

Definition at line 248 of file UserRightsProxy.php.

References $value.

◆ validDatabase()

static UserRightsProxy::validDatabase (   $wikiId)
static

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

Parameters
string$wikiIdDatabase name
Returns
bool

Definition at line 63 of file UserRightsProxy.php.

References $wgLocalDatabases, and $wikiId.

Referenced by UserrightsPage\fetchUser().

◆ whoIs()

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

Same as User::whoIs()

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

Definition at line 76 of file UserRightsProxy.php.

References $id, $user, $wikiId, and newFromId().

Referenced by UserrightsPage\fetchUser().

Member Data Documentation

◆ $db

IDatabase UserRightsProxy::$db
private

Definition at line 31 of file UserRightsProxy.php.

Referenced by __construct(), and newFromLookup().

◆ $id

int UserRightsProxy::$id
private

Definition at line 37 of file UserRightsProxy.php.

Referenced by __construct(), getId(), invalidateCache(), newFromId(), saveSettings(), and whoIs().

◆ $name

string UserRightsProxy::$name
private

Definition at line 35 of file UserRightsProxy.php.

Referenced by __construct(), and newFromName().

◆ $newOptions

array UserRightsProxy::$newOptions
private

Definition at line 39 of file UserRightsProxy.php.

◆ $wikiId

string UserRightsProxy::$wikiId
private

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