MediaWiki  1.23.14
UserRightsProxy Class Reference

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

Public Member Functions

 addGroup ( $group)
 Replaces User::addUserGroup() More...
 
 getDBName ()
 Accessor for $this->database. 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::removeUserGroup() 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 27 of file UserRightsProxy.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

See also
newFromId()
newFromName()
Parameters
$dbDatabaseBase: db connection
string$databasedatabase name
string$nameuser name
$idInteger: user ID

Definition at line 39 of file UserRightsProxy.php.

References $name, array(), database, and name.

Member Function Documentation

◆ addGroup()

UserRightsProxy::addGroup (   $group)

Replaces User::addUserGroup()

Definition at line 203 of file UserRightsProxy.php.

References array().

◆ 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
$databaseString
$ignoreInvalidDBBoolean: if true, don't check if $database is in $wgLocalDatabases
Returns
DatabaseBase or null if invalid selection

Definition at line 139 of file UserRightsProxy.php.

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

Referenced by newFromLookup().

◆ getDBName()

UserRightsProxy::getDBName ( )

Accessor for $this->database.

Returns
String: database name

Definition at line 52 of file UserRightsProxy.php.

◆ getGroups()

UserRightsProxy::getGroups ( )

Replaces User::getUserGroups()

Returns
array

Definition at line 188 of file UserRightsProxy.php.

References $res, array(), and as.

◆ getId()

UserRightsProxy::getId ( )
Returns
int

Definition at line 155 of file UserRightsProxy.php.

Referenced by isAnon().

◆ getName()

UserRightsProxy::getName ( )

Same as User::getName()

Returns
String

Definition at line 171 of file UserRightsProxy.php.

References name.

Referenced by getUserPage().

◆ getUserPage()

UserRightsProxy::getUserPage ( )

Same as User::getUserPage()

Returns
Title object

Definition at line 180 of file UserRightsProxy.php.

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

◆ invalidateCache()

UserRightsProxy::invalidateCache ( )

Replaces User::touchUser()

Definition at line 251 of file UserRightsProxy.php.

References $wgMemc, array(), database, global, and wfForeignMemcKey().

Referenced by saveSettings().

◆ isAnon()

UserRightsProxy::isAnon ( )
Returns
bool

Definition at line 162 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
$idInteger: user ID
$ignoreInvalidDBBoolean: if true, don't check if $database is in $wgLocalDatabases
Returns
UserRightsProxy or null if doesn't exist

Definition at line 92 of file UserRightsProxy.php.

References newFromLookup().

Referenced by whoIs().

◆ newFromLookup()

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

Definition at line 115 of file UserRightsProxy.php.

References $value, array(), and getDB().

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
$ignoreInvalidDBBoolean: if true, don't check if $database is in $wgLocalDatabases
Returns
UserRightsProxy or null if doesn't exist

Definition at line 104 of file UserRightsProxy.php.

References $name, and newFromLookup().

Referenced by UserrightsPage\fetchUser().

◆ removeGroup()

UserRightsProxy::removeGroup (   $group)

Replaces User::removeUserGroup()

Definition at line 216 of file UserRightsProxy.php.

References array().

◆ saveSettings()

UserRightsProxy::saveSettings ( )

Definition at line 232 of file UserRightsProxy.php.

References $value, array(), as, and invalidateCache().

◆ setOption()

UserRightsProxy::setOption (   $option,
  $value 
)

Replaces User::setOption()

Definition at line 228 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
Boolean

Definition at line 62 of file UserRightsProxy.php.

References global.

Referenced by UserrightsPage\fetchUser().

◆ whoIs()

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

Same as User::whoIs()

Parameters
string$databasedatabase name
$idInteger: user ID
$ignoreInvalidDBBoolean: if true, don't check if $database is in $wgLocalDatabases
Returns
String: user name or false if the user doesn't exist

Definition at line 75 of file UserRightsProxy.php.

References $user, and newFromId().

Referenced by UserrightsPage\fetchUser().


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