MediaWiki  master
UserRightsProxy Class Reference

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

Inheritance diagram for UserRightsProxy:
Collaboration diagram for UserRightsProxy:

Public Member Functions

 addGroup ( $group, $expiry=null)
 Replaces User::addGroup() More...
 
 equals (?UserIdentity $user)
 
Since
1.32
Parameters
UserIdentity | null$user
Returns
bool
More...
 
 getGroupMemberships ()
 Replaces User::getGroupMemberships() More...
 
 getGroups ()
 Replaces User::getUserGroups() More...
 
 getId ( $wikiId=self::LOCAL)
 
 getName ()
 Same as User::getName() More...
 
 getUserPage ()
 Same as User::getUserPage() More...
 
 getWikiId ()
 Returns the db Domain of the wiki the UserRightsProxy is associated with. More...
 
 invalidateCache ()
 Replaces User::touchUser() More...
 
 isAnon ()
 
 isRegistered ()
 
Since
1.34
Returns
bool True if user is registered on this wiki, i.e., has a user ID. False if user is anonymous or has no local account (which can happen when importing). This must be equivalent to getId() != 0 and is provided for code readability.
More...
 
 removeGroup ( $group)
 Replaces User::removeGroup() More...
 
 saveSettings ()
 
 setOption ( $option, $value)
 Replaces User::setOption() More...
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId(). More...
 

Static Public Member Functions

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

Detailed Description

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

Deprecated:
since 1.38, pass the correct domain to UserGroupManagerFactory instead.

Definition at line 35 of file UserRightsProxy.php.

Member Function Documentation

◆ addGroup()

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

Replaces User::addGroup()

Parameters
string$group
string | null$expiry
Returns
bool

Definition at line 238 of file UserRightsProxy.php.

◆ equals()

UserRightsProxy::equals ( ?UserIdentity  $user)

Since
1.32
Parameters
UserIdentity | null$user
Returns
bool

Implements MediaWiki\User\UserIdentity.

Definition at line 311 of file UserRightsProxy.php.

◆ getDB()

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

Definition at line 168 of file UserRightsProxy.php.

References DB_PRIMARY, WikiMap\isCurrentWikiId(), and wfGetDB().

◆ getGroupMemberships()

UserRightsProxy::getGroupMemberships ( )

Replaces User::getGroupMemberships()

Returns
UserGroupMembership[]
Since
1.29

Definition at line 227 of file UserRightsProxy.php.

◆ getGroups()

UserRightsProxy::getGroups ( )

Replaces User::getUserGroups()

Returns
string[]

Definition at line 217 of file UserRightsProxy.php.

◆ getId()

UserRightsProxy::getId (   $wikiId = self::LOCAL)
Parameters
string | false$wikiId
Returns
int

Implements MediaWiki\User\UserIdentity.

Definition at line 184 of file UserRightsProxy.php.

◆ getName()

UserRightsProxy::getName ( )

Same as User::getName()

Returns
string

Implements MediaWiki\User\UserIdentity.

Definition at line 200 of file UserRightsProxy.php.

◆ getUserPage()

UserRightsProxy::getUserPage ( )

Same as User::getUserPage()

Returns
Title

Definition at line 209 of file UserRightsProxy.php.

References Title\makeTitle(), and NS_USER.

◆ getWikiId()

UserRightsProxy::getWikiId ( )

Returns the db Domain of the wiki the UserRightsProxy is associated with.

Since
1.37
Returns
string

Implements MediaWiki\DAO\WikiAwareEntity.

Definition at line 331 of file UserRightsProxy.php.

◆ invalidateCache()

UserRightsProxy::invalidateCache ( )

Replaces User::touchUser()

Definition at line 290 of file UserRightsProxy.php.

References User\purge().

◆ isAnon()

UserRightsProxy::isAnon ( )
Returns
bool

Definition at line 191 of file UserRightsProxy.php.

◆ isRegistered()

UserRightsProxy::isRegistered ( )

Since
1.34
Returns
bool True if user is registered on this wiki, i.e., has a user ID. False if user is anonymous or has no local account (which can happen when importing). This must be equivalent to getId() != 0 and is provided for code readability.

Implements MediaWiki\User\UserIdentity.

Definition at line 321 of file UserRightsProxy.php.

◆ newFromId()

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

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

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

Definition at line 107 of file UserRightsProxy.php.

Referenced by whoIs().

◆ newFromName()

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

Factory function; get a remote user entry by name.

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

Definition at line 119 of file UserRightsProxy.php.

Referenced by UserrightsPage\fetchUser().

◆ removeGroup()

UserRightsProxy::removeGroup (   $group)

Replaces User::removeGroup()

Parameters
string$group
Returns
bool

Definition at line 253 of file UserRightsProxy.php.

◆ saveSettings()

UserRightsProxy::saveSettings ( )

Definition at line 269 of file UserRightsProxy.php.

◆ setOption()

UserRightsProxy::setOption (   $option,
  $value 
)

Replaces User::setOption()

Parameters
string$option
mixed$value

Definition at line 265 of file UserRightsProxy.php.

◆ validDatabase()

static UserRightsProxy::validDatabase (   $dbDomain)
static

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

Parameters
string$dbDomainDatabase name
Returns
bool

Definition at line 76 of file UserRightsProxy.php.

Referenced by UserrightsPage\fetchUser().

◆ whoIs()

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

Same as User::whoIs()

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

Definition at line 90 of file UserRightsProxy.php.

References newFromId().

Referenced by UserrightsPage\fetchUser().


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