MediaWiki REL1_39
|
Service for temporary user creation. More...
Public Member Functions | |
__construct (RealTempUserConfig $config, ObjectFactory $objectFactory, UserFactory $userFactory, AuthManager $authManager, ?Throttler $throttler) | |
acquireAndStashName (Session $session) | |
Permanently acquire a username, stash it in a session, and return it. | |
create ( $name=null, WebRequest $request=null) | |
Acquire a serial number, create the corresponding user and log in. | |
getPlaceholderName () | |
Get a placeholder name which matches the reserved prefix. | |
isAutoCreateAction (string $action) | |
Is the action valid for user auto-creation? | |
isEnabled () | |
Is temp user creation enabled? | |
isReservedName (string $name) | |
Does the name match the configured pattern indicating that it is a temporary auto-created user? | |
Service for temporary user creation.
For convenience this also proxies the TempUserConfig methods.
This is separate from TempUserConfig to avoid dependency loops. Special pages and actions are free to use this class, but services should take it as a constructor parameter only if necessary.
Definition at line 25 of file TempUserCreator.php.
MediaWiki\User\TempUser\TempUserCreator::__construct | ( | RealTempUserConfig | $config, |
ObjectFactory | $objectFactory, | ||
UserFactory | $userFactory, | ||
AuthManager | $authManager, | ||
?Throttler | $throttler ) |
Definition at line 78 of file TempUserCreator.php.
References MediaWiki\User\TempUser\RealTempUserConfig\getSerialMappingConfig(), and MediaWiki\User\TempUser\RealTempUserConfig\getSerialProviderConfig().
MediaWiki\User\TempUser\TempUserCreator::acquireAndStashName | ( | Session | $session | ) |
Permanently acquire a username, stash it in a session, and return it.
Do not create the user.
If this method was called before with the same session ID, return the previously stashed username instead of acquiring a new one.
Session | $session |
Definition at line 262 of file TempUserCreator.php.
References MediaWiki\Session\Session\get(), MediaWiki\Session\Session\save(), and MediaWiki\Session\Session\set().
MediaWiki\User\TempUser\TempUserCreator::create | ( | $name = null, | |
WebRequest | $request = null ) |
Acquire a serial number, create the corresponding user and log in.
string | null | $name | Previously acquired name |
WebRequest | null | $request | Request details, used for throttling |
Definition at line 101 of file TempUserCreator.php.
References StatusValue\fatal(), and wfMessage().
MediaWiki\User\TempUser\TempUserCreator::getPlaceholderName | ( | ) |
Get a placeholder name which matches the reserved prefix.
Implements MediaWiki\User\TempUser\TempUserConfig.
Definition at line 157 of file TempUserCreator.php.
MediaWiki\User\TempUser\TempUserCreator::isAutoCreateAction | ( | string | $action | ) |
Is the action valid for user auto-creation?
string | $action |
Implements MediaWiki\User\TempUser\TempUserConfig.
Definition at line 149 of file TempUserCreator.php.
MediaWiki\User\TempUser\TempUserCreator::isEnabled | ( | ) |
Is temp user creation enabled?
Implements MediaWiki\User\TempUser\TempUserConfig.
Definition at line 145 of file TempUserCreator.php.
MediaWiki\User\TempUser\TempUserCreator::isReservedName | ( | string | $name | ) |
Does the name match the configured pattern indicating that it is a temporary auto-created user?
string | $name |
Implements MediaWiki\User\TempUser\TempUserConfig.
Definition at line 153 of file TempUserCreator.php.