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(
102 $oldRow = clone $row;
105 if ( preg_match(
'/^[0-9a-f]{32}$/', $row->user_password ) ) {
106 if ( $this->config->get(
'PasswordSalt' ) ) {
107 $row->user_password =
":B:{$row->user_id}:{$row->user_password}";
109 $row->user_password =
":A:{$row->user_password}";
119 $pwhash = $this->
getPassword( $row->user_password );
120 if ( !$pwhash->equals(
$req->password ) ) {
121 if ( $this->config->get(
'LegacyEncoding' ) ) {
124 $cp1252Password = iconv(
'UTF-8',
'WINDOWS-1252//TRANSLIT',
$req->password );
125 if ( $cp1252Password ===
$req->password || !$pwhash->equals( $cp1252Password ) ) {
140 [
'user_password' => $newHash->toString() ],
142 'user_id' => $oldRow->user_id,
143 'user_password' => $oldRow->user_password
163 $row =
$dbr->selectRow(
175 if ( preg_match(
'/^[0-9a-f]{32}$/', $row->user_password ) ) {
179 return !$this->
getPassword( $row->user_password ) instanceof \InvalidPassword;
189 return (
bool)
wfGetDB( $db )->selectField(
203 if ( $this->loginOnly ) {
204 return \StatusValue::newGood(
'ignored' );
209 return \StatusValue::newGood();
222 if (
$req->password !==
null ) {
223 if (
$req->password !==
$req->retype ) {
224 $sv->fatal(
'badretype' );
234 return \StatusValue::newGood(
'ignored' );
246 if ( $this->loginOnly ) {
260 'user_password' => $pwhash->toString(),
261 'user_password_expires' => $dbw->timestampOrNull( $expiry ),
277 if ( !$this->loginOnly &&
$req &&
$req->username !==
null &&
$req->password !==
null ) {
278 if (
$req->password !==
$req->retype ) {
279 $ret->fatal(
'badretype' );
291 throw new \BadMethodCallException(
'Shouldn\'t call this when accountCreationType() is NONE' );
296 if (
$req->username !==
null &&
$req->password !==
null ) {
299 if (
$req->username !==
$user->getName() ) {
313 throw new \BadMethodCallException(
'Shouldn\'t call this when accountCreationType() is NONE' );
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
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 $req
static newFatal( $message)
Factory function for fatal errors.
static getDBOptions( $bitfield)
Get an appropriate DB index, options, and fallback DB index for a query.
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
static newGood( $value=null)
Factory function for good results.
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 getCanonicalName( $name, $validate='valid')
Given unvalidated user input, return a canonical username, or false if the username is invalid.
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 or null if authentication failed before getting that far $username
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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
it s the revision text itself In either if gzip is the revision text is gzipped $flags
the array() calling protocol came about after MediaWiki 1.4rc1.