Go to the documentation of this file.
67 'title' => $titleObj->getPrefixedText(),
68 'pageid' => intval( $details[
'current']->getPage() ),
69 'summary' => $details[
'summary'],
70 'revid' => intval( $details[
'newid'] ),
71 'old_revid' => intval( $details[
'current']->getID() ),
72 'last_revid' => intval( $details[
'target']->getID() )
102 'watchlist' =>
array(
116 'title' =>
'Title of the page you want to rollback.',
117 'user' =>
'Name of the user whose edits are to be rolled back. If ' .
118 'set incorrectly, you\'ll get a badtoken error.',
119 'token' =>
'A rollback token previously retrieved through ' .
120 "{$this->getModulePrefix()}prop=revisions",
121 'summary' =>
'Custom edit summary. If empty, default summary will be used',
122 'markbot' =>
'Mark the reverted edits and the revert as bot edits',
123 'watchlist' =>
'Unconditionally add or remove the page from your watchlist, ' .
124 'use preferences or do not change watch',
132 'pageid' =>
'integer',
133 'summary' =>
'string',
134 'revid' =>
'integer',
135 'old_revid' =>
'integer',
136 'last_revid' =>
'integer'
143 'Undo the last edit to the page. If the last user who edited the page made',
144 'multiple edits in a row, they will all be rolled back.'
149 return array_merge( parent::getPossibleErrors(),
array(
150 array(
'invalidtitle',
'title' ),
151 array(
'notanarticle' ),
152 array(
'invaliduser',
'user' ),
165 if ( $this->mUser !==
null ) {
175 if ( !$this->mUser ) {
186 if ( $this->mTitleObj !==
null ) {
194 if ( !$this->mTitleObj || $this->mTitleObj->isExternal() ) {
197 if ( !$this->mTitleObj->exists() ) {
206 'api.php?action=rollback&title=Main%20Page&user=Catrope&token=123ABC',
207 'api.php?action=rollback&title=Main%20Page&user=217.121.114.116&' .
208 'token=123ABC&summary=Reverting%20vandalism&markbot=1'
213 return 'https://www.mediawiki.org/wiki/API:Rollback';
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
dieUsageMsg( $error)
Output the error message related to a certain array.
getResult()
Get the result object.
getParamDescription()
Returns an array of parameter descriptions.
getUser()
Get the User object.
This abstract class implements many basic API functions, and is the base of all API classes.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
mustBePosted()
Indicates whether this module must be called with a POST request.
getExamples()
Returns usage examples for this module.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
isWriteMode()
Indicates whether this module requires write mode.
static isIP( $name)
Does the string match an anonymous IPv4 address?
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setWatch( $watch, $titleObj, $userOption=null)
Set a watch (or unwatch) based the based on a watchlist parameter.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getDescription()
Returns the description string for this module.
getPossibleErrors()
Returns a list of all possible errors returned by the module.
Represents a title within MediaWiki.
needsToken()
Returns whether this module requires a token to execute It is used to show possible errors in action=...
static getCanonicalName( $name, $validate='valid')
Given unvalidated user input, return a canonical username, or false if the username is invalid.
getModuleName()
Get the name of the module being executed by this instance.
getTokenSalt()
Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the mo...
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
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 incomplete not yet checked for validity & $retval