|
MediaWiki master
|
Class to parse and build external user names. More...
Public Member Functions | |
| __construct ( $usernamePrefix, $assignKnownUsers) | |
| addPrefix ( $name) | |
| Add an interwiki prefix to the username regardless of circumstances. | |
| applyPrefix ( $name) | |
| Add an interwiki prefix to the username, if appropriate. | |
Static Public Member Functions | |
| static | getLocal ( $username) |
| Get local part of the user name. | |
| static | getUserLinkTitle ( $userName) |
| Get a target Title to link a username. | |
| static | isExternal ( $username) |
| Tells whether the username is external or not. | |
Class to parse and build external user names.
Definition at line 19 of file ExternalUserNames.php.
| MediaWiki\User\ExternalUserNames::__construct | ( | $usernamePrefix, | |
| $assignKnownUsers ) |
| string | $usernamePrefix | Prefix to apply to unknown (and possibly also known) usernames |
| bool | $assignKnownUsers | Whether to apply the prefix to usernames that exist locally |
Definition at line 33 of file ExternalUserNames.php.
| MediaWiki\User\ExternalUserNames::addPrefix | ( | $name | ) |
Add an interwiki prefix to the username regardless of circumstances.
| string | $name |
Definition at line 125 of file ExternalUserNames.php.
Referenced by MediaWiki\User\ExternalUserNames\applyPrefix().
| MediaWiki\User\ExternalUserNames::applyPrefix | ( | $name | ) |
Add an interwiki prefix to the username, if appropriate.
This method does have a side-effect on SUL (single user login) wikis: Calling this calls the ImportHandleUnknownUser hook from the CentralAuth extension, which assigns a local ID to the global user name, if possible. No prefix is applied if this is successful.
| string | $name |
Definition at line 90 of file ExternalUserNames.php.
References MediaWiki\User\ExternalUserNames\addPrefix(), MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\User\UserRigorOptions\RIGOR_USABLE.
|
static |
Get local part of the user name.
| string | $username | Username to get |
Definition at line 145 of file ExternalUserNames.php.
|
static |
Get a target Title to link a username.
| string | $userName | Username to link |
Definition at line 45 of file ExternalUserNames.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\SpecialPage\SpecialPage\getTitleFor(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\makeTitle(), NS_MAIN, and NS_USER.
|
static |
Tells whether the username is external or not.
| string | $username | Username to check |
Definition at line 135 of file ExternalUserNames.php.