Utility class for bot passwords.
More...
|
static | canonicalizeLoginData ( $username, $password) |
| There are two ways to login with a bot password: "username@appId", "password" and "username", "appId@password".
|
|
static | generatePassword ( $config) |
| Returns a (raw, unhashed) random password string.
|
|
static | getDB ( $db) |
| Get a database connection for the bot passwords database.
|
|
static | getSeparator () |
| Get the separator for combined user name + app ID.
|
|
static | invalidateAllPasswordsForCentralId ( $centralId) |
| Invalidate all passwords for a user, by central ID.
|
|
static | invalidateAllPasswordsForUser ( $username) |
| Invalidate all passwords for a user, by name.
|
|
static | login ( $username, $password, WebRequest $request) |
| Try to log the user in.
|
|
static | newFromCentralId ( $centralId, $appId, $flags=self::READ_NORMAL) |
| Load a BotPassword from the database.
|
|
static | newFromUser (User $user, $appId, $flags=self::READ_NORMAL) |
| Load a BotPassword from the database.
|
|
static | newUnsaved (array $data, $flags=self::READ_NORMAL) |
| Create an unsaved BotPassword.
|
|
static | removeAllPasswordsForCentralId ( $centralId) |
| Remove all passwords for a user, by central ID.
|
|
static | removeAllPasswordsForUser ( $username) |
| Remove all passwords for a user, by name.
|
|
Utility class for bot passwords.
- Since
- 1.27
Definition at line 29 of file BotPassword.php.
◆ __construct()
BotPassword::__construct |
( |
| $row, |
|
|
| $isSaved, |
|
|
| $flags = self::READ_NORMAL ) |
|
protected |
◆ canonicalizeLoginData()
static BotPassword::canonicalizeLoginData |
( |
| $username, |
|
|
| $password ) |
|
static |
There are two ways to login with a bot password: "username@appId", "password" and "username", "appId@password".
Transform it so it is always in the first form. Returns [bot username, bot password]. If this cannot be a bot password login just return false.
- Parameters
-
string | $username | |
string | $password | |
- Returns
- array|false
Definition at line 419 of file BotPassword.php.
References $username.
◆ delete()
◆ generatePassword()
static BotPassword::generatePassword |
( |
| $config | ) |
|
|
static |
Returns a (raw, unhashed) random password string.
- Parameters
-
- Returns
- string
Definition at line 405 of file BotPassword.php.
◆ getAppId()
BotPassword::getAppId |
( |
| ) |
|
◆ getDB()
static BotPassword::getDB |
( |
| $db | ) |
|
|
static |
◆ getGrants()
BotPassword::getGrants |
( |
| ) |
|
◆ getPassword()
BotPassword::getPassword |
( |
| ) |
|
|
protected |
◆ getRestrictions()
BotPassword::getRestrictions |
( |
| ) |
|
◆ getSeparator()
static BotPassword::getSeparator |
( |
| ) |
|
|
static |
◆ getToken()
BotPassword::getToken |
( |
| ) |
|
◆ getUserCentralId()
BotPassword::getUserCentralId |
( |
| ) |
|
◆ invalidateAllPasswordsForCentralId()
static BotPassword::invalidateAllPasswordsForCentralId |
( |
| $centralId | ) |
|
|
static |
◆ invalidateAllPasswordsForUser()
static BotPassword::invalidateAllPasswordsForUser |
( |
| $username | ) |
|
|
static |
Invalidate all passwords for a user, by name.
- Parameters
-
- Returns
- bool Whether any passwords were invalidated
Definition at line 338 of file BotPassword.php.
References $username.
◆ isInvalid()
BotPassword::isInvalid |
( |
| ) |
|
◆ isSaved()
◆ login()
static BotPassword::login |
( |
| $username, |
|
|
| $password, |
|
|
WebRequest | $request ) |
|
static |
◆ newFromCentralId()
static BotPassword::newFromCentralId |
( |
| $centralId, |
|
|
| $appId, |
|
|
| $flags = self::READ_NORMAL ) |
|
static |
◆ newFromUser()
static BotPassword::newFromUser |
( |
User | $user, |
|
|
| $appId, |
|
|
| $flags = self::READ_NORMAL ) |
|
static |
◆ newUnsaved()
static BotPassword::newUnsaved |
( |
array | $data, |
|
|
| $flags = self::READ_NORMAL ) |
|
static |
Create an unsaved BotPassword.
- Parameters
-
array | $data | Data to use to create the bot password. Keys are:
- user: (User) User object to create the password for. Overrides username and centralId.
- username: (string) Username to create the password for. Overrides centralId.
- centralId: (int) User central ID to create the password for.
- appId: (string) App ID for the password.
- restrictions: (MWRestrictions, optional) Restrictions.
- grants: (string[], optional) Grants.
|
int | $flags | IDBAccessObject read flags |
- Returns
- BotPassword|null
Definition at line 137 of file BotPassword.php.
References MWRestrictions\newDefault(), and object.
◆ removeAllPasswordsForCentralId()
static BotPassword::removeAllPasswordsForCentralId |
( |
| $centralId | ) |
|
|
static |
◆ removeAllPasswordsForUser()
static BotPassword::removeAllPasswordsForUser |
( |
| $username | ) |
|
|
static |
◆ save()
BotPassword::save |
( |
| $operation, |
|
|
Password | $password = null ) |
◆ $appId
string BotPassword::$appId |
|
private |
◆ $centralId
int BotPassword::$centralId |
|
private |
◆ $flags
int BotPassword::$flags = self::READ_NORMAL |
|
private |
◆ $grants
string [] BotPassword::$grants |
|
private |
◆ $isSaved
bool BotPassword::$isSaved |
|
private |
◆ $restrictions
◆ $token
string BotPassword::$token |
|
private |
◆ APPID_MAXLENGTH
const BotPassword::APPID_MAXLENGTH = 32 |
The documentation for this class was generated from the following file: