40 if ( $policyVal > strlen( $password ) ) {
41 $status->error(
'passwordtooshort', $policyVal );
55 if ( $policyVal > strlen( $password ) ) {
56 $status->fatal(
'passwordtooshort', $policyVal );
70 if ( $policyVal < strlen( $password ) ) {
71 $status->fatal(
'passwordtoolong', $policyVal );
87 if ( $policyVal && $wgContLang->lc( $password ) === $wgContLang->lc(
$username ) ) {
88 $status->error(
'password-name-match' );
101 static $blockedLogins = [
102 'Useruser' =>
'Passpass',
'Useruser1' =>
'Passpass1', # r75589
103 'Apitestsysop' =>
'testpass',
'Apitestuser' =>
'testpass' # r75605
109 if ( isset( $blockedLogins[
$username] ) && $password == $blockedLogins[$username] ) {
110 $status->error(
'password-login-forbidden' );
114 if ( $password ===
'ExamplePassword' ) {
115 $status->error(
'password-login-forbidden' );
135 if ( $policyVal > 0 ) {
137 $passwordKey = $langEn->lc( trim( $password ) );
142 $sitename = $langEn->lc( trim( $wgSitename ) );
143 $hardcodedCommonPasswords = [
'',
'wiki',
'mediawiki', $sitename ];
144 if ( in_array( $passwordKey, $hardcodedCommonPasswords ) ) {
145 $status->error(
'passwordtoopopular' );
156 $res = $db->get( $passwordKey );
157 if (
$res && (
int)
$res <= $policyVal ) {
161 $status->error(
'passwordtoopopular' );
static checkMinimalPasswordLength($policyVal, User $user, $password)
Check password is longer than minimum, not fatal.
$wgSitename
Name of the site.
static checkPasswordCannotMatchBlacklist($policyVal, User $user, $password)
Check if username and password are on a blacklist.
when a variable name is used in a it is silently declared as a new local masking the global
getName()
Get the user name, or the IP of an anonymous user.
Functions to check passwords against a policy requirement.
static checkPopularPasswordBlacklist($policyVal, User $user, $password)
Ensure that password isn't in top X most popular passwords.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
this hook is for auditing only or null if authentication failed before getting that far $username
static checkPasswordCannotMatchUsername($policyVal, User $user, $password)
Check if username and password match.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
static factory($code)
Get a cached or new language object for a given language code.
static checkMaximalPasswordLength($policyVal, User $user, $password)
Check password is shorter than maximum, fatal.
static newGood($value=null)
Factory function for good results.
static checkMinimumPasswordLengthToLogin($policyVal, User $user, $password)
Check password is longer than minimum, fatal.