MediaWiki master
|
Expire temporary accounts that are registered for longer than expiryAfterDays
days (defined in $wgAutoCreateTempUser) by forcefully logging them out.
More...
Inherits Maintenance.
Public Member Functions | |
__construct () | |
execute () | |
Protected Member Functions | |
expireTemporaryAccount (UserIdentity $tempAccountUserIdentity) | |
Expire a temporary account. | |
getTempAccountsToExpireQueryBuilder (int $registeredBeforeUnix, int $frequencyDays) | |
Return a SelectQueryBuilder that returns temp accounts to invalidate. | |
initServices () | |
Construct services the script needs to use. | |
queryBuilderToUserIdentities (SelectQueryBuilder $queryBuilder) | |
Convert a SelectQueryBuilder into a list of user identities. | |
verboseLog (string $log) | |
If –verbose is passed, log to output. | |
Protected Attributes | |
AuthManager | $authManager |
TempUserConfig | $tempUserConfig |
UserFactory | $userFactory |
UserIdentityLookup | $userIdentityLookup |
UserIdentityUtils | $userIdentityUtils |
Expire temporary accounts that are registered for longer than expiryAfterDays
days (defined in $wgAutoCreateTempUser) by forcefully logging them out.
Extensions can extend this class to provide their own logic of determining a list of temporary accounts to expire.
Definition at line 28 of file expireTemporaryAccounts.php.
ExpireTemporaryAccounts::__construct | ( | ) |
Definition at line 36 of file expireTemporaryAccounts.php.
ExpireTemporaryAccounts::execute | ( | ) |
Definition at line 150 of file expireTemporaryAccounts.php.
References wfTimestamp().
|
protected |
Expire a temporary account.
Default implementation calls AuthManager::revokeAccessForUser and SessionManager::invalidateSessionsForUser.
UserIdentity | $tempAccountUserIdentity |
Definition at line 140 of file expireTemporaryAccounts.php.
|
protected |
Return a SelectQueryBuilder that returns temp accounts to invalidate.
This method should return temporary accounts that registered before $registeredBeforeUnix. To avoid returning an ever-growing set of accounts, the method should skip users that were supposedly invalidated by a previous script run (script runs each $frequencyDays days).
If you override this method, you probably also want to override queryBuilderToUserIdentities().
int | $registeredBeforeUnix | Cutoff Unix timestamp |
int | $frequencyDays | Script runs each $frequencyDays days |
Definition at line 92 of file expireTemporaryAccounts.php.
|
protected |
Construct services the script needs to use.
Definition at line 55 of file expireTemporaryAccounts.php.
|
protected |
Convert a SelectQueryBuilder into a list of user identities.
Default implementation expects $queryBuilder is an instance of UserSelectQueryBuilder. If you override getTempAccountsToExpireQueryBuilder() to work with a different query builder, this method should be overriden to properly convert the query builder into user identities.
LogicException | if $queryBuilder is not UserSelectQueryBuilder |
SelectQueryBuilder | $queryBuilder |
Definition at line 120 of file expireTemporaryAccounts.php.
|
protected |
If –verbose is passed, log to output.
string | $log |
Definition at line 71 of file expireTemporaryAccounts.php.
|
protected |
Definition at line 32 of file expireTemporaryAccounts.php.
|
protected |
Definition at line 33 of file expireTemporaryAccounts.php.
|
protected |
Definition at line 31 of file expireTemporaryAccounts.php.
|
protected |
Definition at line 30 of file expireTemporaryAccounts.php.
|
protected |
Definition at line 34 of file expireTemporaryAccounts.php.