Go to the documentation of this file.
46 $this->loginOnly = !empty(
$params[
'loginOnly'] );
52 if ( $expiration ===
null || $expiration >= $now ) {
56 $grace = $this->config->get(
'PasswordExpireGrace' );
57 if ( $expiration + $grace < $now ) {
78 if (
$req->username ===
null ||
$req->password ===
null ) {
88 'user_id',
'user_password',
'user_password_expires',
92 $row =
$dbr->selectRow(
105 $oldRow = clone $row;
108 if ( preg_match(
'/^[0-9a-f]{32}$/', $row->user_password ) ) {
109 if ( $this->config->get(
'PasswordSalt' ) ) {
110 $row->user_password =
":A:{$row->user_id}:{$row->user_password}";
112 $row->user_password =
":A:{$row->user_password}";
122 $pwhash = $this->
getPassword( $row->user_password );
123 if ( !$pwhash->equals(
$req->password ) ) {
124 if ( $this->config->get(
'LegacyEncoding' ) ) {
127 $cp1252Password = iconv(
'UTF-8',
'WINDOWS-1252//TRANSLIT',
$req->password );
128 if ( $cp1252Password ===
$req->password || !$pwhash->equals( $cp1252Password ) ) {
143 [
'user_password' => $pwhash->toString() ],
145 'user_id' => $oldRow->user_id,
146 'user_password' => $oldRow->user_password
166 $row =
$dbr->selectRow(
178 if ( preg_match(
'/^[0-9a-f]{32}$/', $row->user_password ) ) {
182 return !$this->
getPassword( $row->user_password ) instanceof \InvalidPassword;
192 return (
bool)
wfGetDB( $db )->selectField(
206 if ( $this->loginOnly ) {
207 return \StatusValue::newGood(
'ignored' );
212 return \StatusValue::newGood();
225 if (
$req->password !==
null ) {
226 if (
$req->password !==
$req->retype ) {
227 $sv->fatal(
'badretype' );
237 return \StatusValue::newGood(
'ignored' );
248 if ( $this->loginOnly ) {
263 'user_password' => $pwhash->toString(),
264 'user_password_expires' => $dbw->timestampOrNull( $expiry ),
280 if ( !$this->loginOnly &&
$req &&
$req->username !==
null &&
$req->password !==
null ) {
281 if (
$req->password !==
$req->retype ) {
282 $ret->fatal(
'badretype' );
294 throw new \BadMethodCallException(
'Shouldn\'t call this when accountCreationType() is NONE' );
299 if (
$req->username !==
null &&
$req->password !==
null ) {
302 if (
$req->username !==
$user->getName() ) {
316 throw new \BadMethodCallException(
'Shouldn\'t call this when accountCreationType() is NONE' );
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
the array() calling protocol came about after MediaWiki 1.4rc1.
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
static newFatal( $message)
Factory function for fatal errors.
static getDBOptions( $bitfield)
Get an appropriate DB index, options, and fallback DB index for a query.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
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
static addCallableUpdate( $callable, $stage=self::POSTSEND, IDatabase $dbw=null)
Add a callable update.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestampOrNull( $outputtype=TS_UNIX, $ts=null)
Return a formatted timestamp, or null if input is null.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
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 account $user
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 and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
static newGood( $value=null)
Factory function for good results.
this hook is for auditing only $req
static getCanonicalName( $name, $validate='valid')
Given unvalidated user input, return a canonical username, or false if the username is invalid.
this hook is for auditing only or null if authentication failed before getting that far $username
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
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