53 $this->
id = intval(
$id );
54 $this->newOptions = [];
129 if (
$db && $userdb ) {
130 $row = $userdb->selectRow(
'user',
131 [
'user_id',
'user_name' ],
132 [ $field => $value ],
135 if ( $row !==
false ) {
137 $db,
$dbDomain, $row->user_name, intval( $row->user_id ) );
152 if ( $ignoreInvalidDB || self::validDatabase(
$dbDomain ) ) {
153 if ( WikiMap::isCurrentWikiId(
$dbDomain ) ) {
174 return $this->
getId() == 0;
200 return array_keys( self::getGroupMemberships() );
210 return UserGroupMembership::getMembershipsForUser( $this->
id, $this->db );
226 return $ugm->insert(
true, $this->db );
236 $ugm = UserGroupMembership::getMembership( $this->
id, $group, $this->db );
240 return $ugm->delete( $this->db );
249 $this->newOptions[$option] = $value;
254 foreach ( $this->newOptions as $option => $value ) {
257 'up_property' => $option,
258 'up_value' => $value,
261 $this->db->replace(
'user_properties',
262 [ [
'up_user',
'up_property' ] ],
274 [
'user_touched' => $this->db->timestamp() ],
275 [
'user_id' => $this->id ],
279 $domainId = $this->db->getDomainID();
281 $this->db->onTransactionPreCommitOrIdle(
282 function () use ( $domainId, $userId ) {
$wgSharedDB
Shared database for multiple wikis.
string[] $wgLocalDatabases
Other wikis on this site, can be administered from a single developer account.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Represents a "user group membership" – a specific instance of a user belonging to a group.
Cut-down copy of User interface for local-interwiki-database user rights manipulation.
static newFromId( $dbDomain, $id, $ignoreInvalidDB=false)
Factory function; get a remote user entry by ID number.
getName()
Same as User::getName()
getGroupMemberships()
Replaces User::getGroupMemberships()
static whoIs( $dbDomain, $id, $ignoreInvalidDB=false)
Same as User::whoIs()
removeGroup( $group)
Replaces User::removeGroup()
static newFromName( $dbDomain, $name, $ignoreInvalidDB=false)
Factory function; get a remote user entry by name.
static validDatabase( $dbDomain)
Confirm the selected database name is a valid local interwiki database name.
static newFromLookup( $dbDomain, $field, $value, $ignoreInvalidDB=false)
getGroups()
Replaces User::getUserGroups()
setOption( $option, $value)
Replaces User::setOption()
__construct( $db, $dbDomain, $name, $id)
invalidateCache()
Replaces User::touchUser()
static getDB( $dbDomain, $ignoreInvalidDB=false)
Open a database connection to work on for the requested user.
addGroup( $group, $expiry=null)
Replaces User::addGroup()
getUserPage()
Same as User::getUserPage()
static purge( $dbDomain, $userId)