MediaWiki
1.32.5
|
Backwards-compatibility wrapper for AuthManager via $wgAuth. More...
Public Member Functions | |
__construct () | |
addUser ( $user, $password, $email='', $realname='') | |
Add a user to the external authentication database. More... | |
allowPasswordChange () | |
Can users change their passwords? More... | |
allowPropChange ( $prop='') | |
Allow a property change? Properties are the same as preferences and use the same keys. More... | |
allowSetLocalPassword () | |
Should MediaWiki store passwords in its local database? More... | |
authenticate ( $username, $password) | |
Check if a username+password pair is a valid login. More... | |
autoCreate () | |
Return true if the wiki should create a new local account automatically when asked to login a user who doesn't exist locally but does in the external auth database. More... | |
canCreateAccounts () | |
Check to see if external accounts can be created. More... | |
domainList () | |
Get a list of domains (in HTMLForm options format) used. More... | |
getCanonicalName ( $username) | |
If you want to munge the case of an account name before the final check, now is your chance. More... | |
getDomain () | |
Get the user's domain. More... | |
getUserInstance (User &$user) | |
Get an instance of a User object. More... | |
initUser (&$user, $autocreate=false) | |
When creating a user account, optionally fill in preferences and such. More... | |
modifyUITemplate (&$template, &$type) | |
Modify options in the login template. More... | |
setDomain ( $domain) | |
Set the domain this plugin is supposed to use when authenticating. More... | |
setPassword ( $user, $password) | |
Set the given password in the authentication database. More... | |
strict () | |
Return true to prevent logins that don't authenticate here from being checked against the local database's password fields. More... | |
strictUserAuth ( $username) | |
Check if a user should authenticate locally if the global authentication fails. More... | |
updateExternalDB ( $user) | |
Update user information in the external authentication database. More... | |
updateExternalDBGroups ( $user, $addgroups, $delgroups=[]) | |
Update user groups in the external authentication database. More... | |
updateUser (&$user) | |
When a user logs in, optionally fill in preferences and such. More... | |
userExists ( $name) | |
Check whether there exists a user account with the given name. More... | |
validDomain ( $domain) | |
Check to see if the specific domain is a valid domain. More... | |
Protected Attributes | |
string null | $domain = null |
LoggerInterface | $logger = null |
Protected Attributes inherited from AuthPlugin | |
string | $domain |
Backwards-compatibility wrapper for AuthManager via $wgAuth.
Definition at line 31 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::__construct | ( | ) |
Definition at line 38 of file AuthManagerAuthPlugin.php.
References MediaWiki\Logger\LoggerFactory\getInstance().
MediaWiki\Auth\AuthManagerAuthPlugin::addUser | ( | $user, | |
$password, | |||
$email = '' , |
|||
$realname = '' |
|||
) |
Add a user to the external authentication database.
Return true if successful.
User | $user | Only the name should be assumed valid at this point |
string | $password | |
string | ||
string | $realname |
Reimplemented from AuthPlugin.
Definition at line 165 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::allowPasswordChange | ( | ) |
Can users change their passwords?
Reimplemented from AuthPlugin.
Definition at line 107 of file AuthManagerAuthPlugin.php.
References $req, MediaWiki\Auth\AuthManager\ACTION_CHANGE, as, and MediaWiki\Auth\AuthManager\singleton().
MediaWiki\Auth\AuthManagerAuthPlugin::allowPropChange | ( | $prop = '' | ) |
Allow a property change? Properties are the same as preferences and use the same keys.
'Realname' 'Emailaddress' and 'Nickname' all reference this.
string | $prop |
Reimplemented from AuthPlugin.
Definition at line 103 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManager\singleton().
MediaWiki\Auth\AuthManagerAuthPlugin::allowSetLocalPassword | ( | ) |
Should MediaWiki store passwords in its local database?
Reimplemented from AuthPlugin.
Definition at line 118 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::authenticate | ( | $username, | |
$password | |||
) |
Check if a username+password pair is a valid login.
The name will be normalized to MediaWiki's requirements, so you might need to munge it (for instance, for lowercase initial letters).
string | $username | Username. |
string | $password | User password. |
Reimplemented from AuthPlugin.
Definition at line 46 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManagerAuthPlugin\$domain, $res, $username, MediaWiki\Auth\AuthManager\ACTION_LOGIN, MediaWiki\Auth\AuthenticationResponse\FAIL, MediaWiki\Auth\AuthenticationRequest\loadRequestsFromSubmission(), MediaWiki\Auth\AuthenticationResponse\PASS, and MediaWiki\Auth\AuthManager\singleton().
MediaWiki\Auth\AuthManagerAuthPlugin::autoCreate | ( | ) |
Return true if the wiki should create a new local account automatically when asked to login a user who doesn't exist locally but does in the external auth database.
If you don't automatically create accounts, you must still create accounts in some way. It's not possible to authenticate without a local account.
This is just a question, and shouldn't perform any actions.
Reimplemented from AuthPlugin.
Definition at line 99 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::canCreateAccounts | ( | ) |
Check to see if external accounts can be created.
Return true if external accounts can be created.
Reimplemented from AuthPlugin.
Definition at line 161 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManager\singleton().
MediaWiki\Auth\AuthManagerAuthPlugin::domainList | ( | ) |
Get a list of domains (in HTMLForm options format) used.
Reimplemented from AuthPlugin.
Definition at line 198 of file AuthManagerAuthPlugin.php.
Referenced by MediaWiki\Auth\AuthManagerAuthPlugin\validDomain().
MediaWiki\Auth\AuthManagerAuthPlugin::getCanonicalName | ( | $username | ) |
If you want to munge the case of an account name before the final check, now is your chance.
string | $username |
Reimplemented from AuthPlugin.
Definition at line 189 of file AuthManagerAuthPlugin.php.
References $username.
MediaWiki\Auth\AuthManagerAuthPlugin::getDomain | ( | ) |
Get the user's domain.
Reimplemented from AuthPlugin.
Definition at line 81 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManagerAuthPlugin\$domain.
MediaWiki\Auth\AuthManagerAuthPlugin::getUserInstance | ( | User & | $user | ) |
Get an instance of a User object.
User | &$user |
Reimplemented from AuthPlugin.
Definition at line 194 of file AuthManagerAuthPlugin.php.
References $user.
MediaWiki\Auth\AuthManagerAuthPlugin::initUser | ( | & | $user, |
$autocreate = false |
|||
) |
When creating a user account, optionally fill in preferences and such.
For instance, you might pull the email address or real name from the external user database.
The User object is passed by reference so it can be modified; don't forget the & on your function declaration.
User | &$user | |
bool | $autocreate | True if user is being autocreated on login |
Reimplemented from AuthPlugin.
Definition at line 185 of file AuthManagerAuthPlugin.php.
References $user, and Hooks\run().
MediaWiki\Auth\AuthManagerAuthPlugin::modifyUITemplate | ( | & | $template, |
& | $type | ||
) |
Modify options in the login template.
BaseTemplate | &$template | |
string | &$type | 'signup' or 'login'. Added in 1.16. |
Reimplemented from AuthPlugin.
Definition at line 73 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::setDomain | ( | $domain | ) |
Set the domain this plugin is supposed to use when authenticating.
string | $domain | Authentication domain. |
Reimplemented from AuthPlugin.
Definition at line 77 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManagerAuthPlugin\$domain.
MediaWiki\Auth\AuthManagerAuthPlugin::setPassword | ( | $user, | |
$password | |||
) |
Set the given password in the authentication database.
As a special case, the password may be set to null to request locking the password to an unusable value, with the expectation that it will be set later through a mail reset or other method.
Return true if successful.
Reimplemented from AuthPlugin.
Definition at line 123 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManagerAuthPlugin\$domain, $req, $user, MediaWiki\Auth\AuthManager\ACTION_CHANGE, as, MediaWiki\Auth\AuthenticationRequest\loadRequestsFromSubmission(), and MediaWiki\Auth\AuthManager\singleton().
MediaWiki\Auth\AuthManagerAuthPlugin::strict | ( | ) |
Return true to prevent logins that don't authenticate here from being checked against the local database's password fields.
This is just a question, and shouldn't perform any actions.
Reimplemented from AuthPlugin.
Definition at line 175 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::strictUserAuth | ( | $username | ) |
Check if a user should authenticate locally if the global authentication fails.
If either this or strict() returns true, local authentication is not used.
string | $username | Username. |
Reimplemented from AuthPlugin.
Definition at line 180 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::updateExternalDB | ( | $user | ) |
Update user information in the external authentication database.
Return true if successful.
User | $user |
Reimplemented from AuthPlugin.
Definition at line 149 of file AuthManagerAuthPlugin.php.
References $user.
MediaWiki\Auth\AuthManagerAuthPlugin::updateExternalDBGroups | ( | $user, | |
$addgroups, | |||
$delgroups = [] |
|||
) |
Update user groups in the external authentication database.
Return true if successful.
User | $user | |
array | $addgroups | Groups to add. |
array | $delgroups | Groups to remove. |
Reimplemented from AuthPlugin.
Definition at line 155 of file AuthManagerAuthPlugin.php.
MediaWiki\Auth\AuthManagerAuthPlugin::updateUser | ( | & | $user | ) |
When a user logs in, optionally fill in preferences and such.
For instance, you might pull the email address or real name from the external user database.
The User object is passed by reference so it can be modified; don't forget the & on your function declaration.
User | &$user |
Reimplemented from AuthPlugin.
Definition at line 94 of file AuthManagerAuthPlugin.php.
References $user, and Hooks\run().
MediaWiki\Auth\AuthManagerAuthPlugin::userExists | ( | $username | ) |
Check whether there exists a user account with the given name.
The name will be normalized to MediaWiki's requirements, so you might need to munge it (for instance, for lowercase initial letters).
string | $username | Username. |
Reimplemented from AuthPlugin.
Definition at line 42 of file AuthManagerAuthPlugin.php.
References $name, and MediaWiki\Auth\AuthManager\singleton().
MediaWiki\Auth\AuthManagerAuthPlugin::validDomain | ( | $domain | ) |
Check to see if the specific domain is a valid domain.
string | $domain | Authentication domain. |
Reimplemented from AuthPlugin.
Definition at line 89 of file AuthManagerAuthPlugin.php.
References MediaWiki\Auth\AuthManagerAuthPlugin\$domain, and MediaWiki\Auth\AuthManagerAuthPlugin\domainList().
|
protected |
Definition at line 33 of file AuthManagerAuthPlugin.php.
Referenced by MediaWiki\Auth\AuthManagerAuthPlugin\authenticate(), MediaWiki\Auth\AuthManagerAuthPlugin\getDomain(), MediaWiki\Auth\AuthManagerAuthPlugin\setDomain(), MediaWiki\Auth\AuthManagerAuthPlugin\setPassword(), and MediaWiki\Auth\AuthManagerAuthPlugin\validDomain().
|
protected |
Definition at line 36 of file AuthManagerAuthPlugin.php.