41 $this->
addWarning( [
'apiwarn-tokens-origin' ] );
70 'rollback' =>
'rollback',
71 'userrights' =>
'userrights',
72 'login' => [
'',
'login' ],
73 'createaccount' => [
'',
'createaccount' ],
75 Hooks::run(
'ApiQueryTokensRegisterTypes', [ &$salts ] );
97 return $session->getToken( ...$salt );
99 return $user->getEditTokenObject( $salt, $session->getRequest() );
115 'action=query&meta=tokens'
116 =>
'apihelp-query+tokens-example-simple',
117 'action=query&meta=tokens&type=watch|patrol'
118 =>
'apihelp-query+tokens-example-types',
132 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Tokens';
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
getModuleName()
Get the name of the module being executed by this instance.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
This is a base class for all Query modules.
Module to fetch tokens via action=query&meta=tokens.
static getTokenTypeSalts()
Get the salts for known token types.
static getToken(User $user, MediaWiki\Session\Session $session, $salt)
Get a token from a salt.
getCacheMode( $params)
Get the cache mode for the data generated by this module.
getHelpUrls()
Return links to more detailed help pages about the module.
isReadMode()
Indicates whether this module requires read rights.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getExamplesMessages()
Returns usage examples for this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
const META_TYPE
Key for the 'type' metadata item.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...