|
MediaWiki master
|
A CentralIdLookup provider that just uses local IDs. More...
Inherits MediaWiki\User\CentralId\CentralIdLookup.

Public Member Functions | ||||||||||||||||
| __construct (Config $config, IConnectionProvider $dbProvider, HideUserUtils $hideUserUtils) | ||||||||||||||||
| getScope () | ||||||||||||||||
Return a scope that can be used to differentiate the central IDs returned by this object from central IDs returned by different CentralIdLookup implementations and/or on different wikis of the same farm.The scope will take the form of <provider-id>:<instance-id> where <provider-id> is the CentralIdLookup provider's ID (as in ::getProviderId()), and <instance-id> is used to differentiate between multiple instances of the same provider (e.g. could be a wiki ID for farms where each wiki has its own userbase); it is an arbitrary string (possibly empty) except it can't contain any more : characters.Most subclasses should override the default implementation.
| ||||||||||||||||
| isAttached (UserIdentity $user, $wikiId=UserIdentity::LOCAL) | ||||||||||||||||
Check that a user is attached on the specified wiki.If unattached local accounts don't exist in your extension, this comes down to a check whether the central account exists at all and that $wikiId is using the same central database.
| ||||||||||||||||
| lookupCentralIds (array $idToName, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
Given central user IDs, return the (local) user names.
| ||||||||||||||||
| lookupUserNamesWithFilter (array $nameToId, $filter, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL, $wikiId=UserIdentity::LOCAL) | ||||||||||||||||
Given user names on the wiki specified by $wikiId, return the central IDs.If $filter is not FILTER_NONE, filter the users by owned or attached status.
| ||||||||||||||||
Public Member Functions inherited from MediaWiki\User\CentralId\CentralIdLookup | ||||||||||||||||
| centralIdFromLocalUser (UserIdentity $user, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given a local UserIdentity object, return the central ID. | ||||||||||||||||
| centralIdFromName ( $name, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given a (local) user name, return the central ID. | ||||||||||||||||
| centralIdsFromNames (array $names, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given an array of (local) user names, return the central IDs. | ||||||||||||||||
| getProviderId () | ||||||||||||||||
| init (string $providerId, UserIdentityLookup $userIdentityLookup, UserFactory $userFactory) | ||||||||||||||||
| Initialize the provider. | ||||||||||||||||
| isOwned (UserIdentity $user, $wikiId=UserIdentity::LOCAL) | ||||||||||||||||
| Check that a username is owned by the central user on the specified wiki. | ||||||||||||||||
| localUserFromCentralId ( $id, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given a central user ID, return a local user object. | ||||||||||||||||
| lookupAttachedUserNames (array $nameToId, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL, $wikiId=UserIdentity::LOCAL) | ||||||||||||||||
| Given user names on the wiki specified by $wikiId, return the central IDs, but only include IDs for local users attached to the central user, i.e. | ||||||||||||||||
| lookupOwnedUserNames (array $nameToId, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL, $wikiId=UserIdentity::LOCAL) | ||||||||||||||||
| Given user names on the wiki specified by $wikiId, return the central IDs, but only include IDs for local users owned by the central user, i.e. | ||||||||||||||||
| lookupUserNames (array $nameToId, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given (local) user names, return the central IDs. | ||||||||||||||||
| nameFromCentralId ( $id, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given a central user ID, return the (local) user name. | ||||||||||||||||
| namesFromCentralIds (array $ids, $audience=self::AUDIENCE_PUBLIC, $flags=IDBAccessObject::READ_NORMAL) | ||||||||||||||||
| Given a an array of central user IDs, return the (local) user names. | ||||||||||||||||
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\User\CentralId\CentralIdLookup | |
| const | AUDIENCE_PUBLIC = 1 |
| const | AUDIENCE_RAW = 2 |
| const | FILTER_ATTACHED = 'attached' |
| const | FILTER_NONE = 'none' |
| const | FILTER_OWNED = 'owned' |
Protected Member Functions inherited from MediaWiki\User\CentralId\CentralIdLookup | |
| checkAudience ( $audience) | |
| Check that the "audience" parameter is valid. | |
A CentralIdLookup provider that just uses local IDs.
Useful if the wiki isn't part of a cluster or you're using shared user tables.
Definition at line 28 of file LocalIdLookup.php.
| MediaWiki\User\CentralId\LocalIdLookup::__construct | ( | Config | $config, |
| IConnectionProvider | $dbProvider, | ||
| HideUserUtils | $hideUserUtils ) |
| Config | $config | |
| IConnectionProvider | $dbProvider | |
| HideUserUtils | $hideUserUtils |
Definition at line 47 of file LocalIdLookup.php.
References MediaWiki\Config\Config\get(), MediaWiki\MainConfigNames\LocalDatabases, MediaWiki\MainConfigNames\SharedDB, and MediaWiki\MainConfigNames\SharedTables.
| MediaWiki\User\CentralId\LocalIdLookup::getScope | ( | ) |
Return a scope that can be used to differentiate the central IDs returned by this object from central IDs returned by different CentralIdLookup implementations and/or on different wikis of the same farm.The scope will take the form of <provider-id>:<instance-id> where <provider-id> is the CentralIdLookup provider's ID (as in ::getProviderId()), and <instance-id> is used to differentiate between multiple instances of the same provider (e.g. could be a wiki ID for farms where each wiki has its own userbase); it is an arbitrary string (possibly empty) except it can't contain any more : characters.Most subclasses should override the default implementation.
Reimplemented from MediaWiki\User\CentralId\CentralIdLookup.
Definition at line 154 of file LocalIdLookup.php.
| MediaWiki\User\CentralId\LocalIdLookup::isAttached | ( | UserIdentity | $user, |
| $wikiId = UserIdentity::LOCAL ) |
Check that a user is attached on the specified wiki.If unattached local accounts don't exist in your extension, this comes down to a check whether the central account exists at all and that $wikiId is using the same central database.
| UserIdentity | $user | |
| string | false | $wikiId | Wiki to check attachment status. If false, check the current wiki. |
Reimplemented from MediaWiki\User\CentralId\CentralIdLookup.
Definition at line 60 of file LocalIdLookup.php.
| MediaWiki\User\CentralId\LocalIdLookup::lookupCentralIds | ( | array | $idToName, |
| $audience = self::AUDIENCE_PUBLIC, | |||
| $flags = IDBAccessObject::READ_NORMAL ) |
Given central user IDs, return the (local) user names.
| array | $idToName | Array with keys being central user IDs |
| int | Authority | $audience | One of the audience constants, or a specific authority |
| int | $flags | IDBAccessObject read flags |
Reimplemented from MediaWiki\User\CentralId\CentralIdLookup.
Definition at line 89 of file LocalIdLookup.php.
| MediaWiki\User\CentralId\LocalIdLookup::lookupUserNamesWithFilter | ( | array | $nameToId, |
| $filter, | |||
| $audience = self::AUDIENCE_PUBLIC, | |||
| $flags = IDBAccessObject::READ_NORMAL, | |||
| $wikiId = UserIdentity::LOCAL ) |
Given user names on the wiki specified by $wikiId, return the central IDs.If $filter is not FILTER_NONE, filter the users by owned or attached status.
| array | $nameToId | Array with keys being canonicalized user names |
| string | $filter | One of:
|
| int | Authority | $audience | One of the audience constants, or a specific authority |
| int | $flags | IDBAccessObject read flags |
| string | false | $wikiId | Wiki to check attachment status. If false, check the current wiki. |
Reimplemented from MediaWiki\User\CentralId\CentralIdLookup.
Definition at line 117 of file LocalIdLookup.php.