58 $this->
id = intval(
$id );
59 $this->newOptions = [];
60 $this->userGroupManager = MediaWikiServices::getInstance()
61 ->getUserGroupManagerFactory()
137 if (
$db && $userdb ) {
138 $row = $userdb->selectRow(
'user',
139 [
'user_id',
'user_name' ],
140 [ $field => $value ],
143 if ( $row !==
false ) {
145 $db,
$dbDomain, $row->user_name, intval( $row->user_id ) );
160 if ( $ignoreInvalidDB || self::validDatabase(
$dbDomain ) ) {
161 if ( WikiMap::isCurrentWikiId(
$dbDomain ) ) {
182 return $this->
getId() == 0;
208 return array_keys( self::getGroupMemberships() );
223 return $this->userGroupManager->getUserGroupMemberships( $user, IDBAccessObject::READ_LATEST );
233 public function addGroup( $group, $expiry =
null ) {
234 return $this->userGroupManager->addUserToGroup(
251 return $this->userGroupManager->removeUserFromGroup(
265 $this->newOptions[$option] = $value;
270 foreach ( $this->newOptions as $option => $value ) {
273 'up_property' => $option,
274 'up_value' => $value,
279 [ [
'up_user',
'up_property' ] ],
292 [
'user_touched' => $this->db->timestamp() ],
293 [
'user_id' => $this->id ],
297 $domainId = $this->db->getDomainID();
299 $this->db->onTransactionPreCommitOrIdle(
300 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.
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()
UserGroupManager $userGroupManager
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)