Go to the documentation of this file.
37 parent::__construct(
$query, $moduleName,
'ui' );
44 if ( !is_null(
$params[
'prop'] ) ) {
45 $this->prop = array_flip(
$params[
'prop'] );
57 $vals[
'id'] = intval(
$user->getId() );
58 $vals[
'name'] =
$user->getName();
60 if (
$user->isAnon() ) {
64 if ( isset( $this->prop[
'blockinfo'] ) ) {
65 if (
$user->isBlocked() ) {
66 $block =
$user->getBlock();
67 $vals[
'blockid'] = $block->getId();
68 $vals[
'blockedby'] = $block->getByName();
69 $vals[
'blockedbyid'] = $block->getBy();
70 $vals[
'blockreason'] =
$user->blockedFor();
74 if ( isset( $this->prop[
'hasmsg'] ) &&
$user->getNewtalk() ) {
75 $vals[
'messages'] =
'';
78 if ( isset( $this->prop[
'groups'] ) ) {
79 $vals[
'groups'] =
$user->getEffectiveGroups();
80 $result->setIndexedTagName( $vals[
'groups'],
'g' );
83 if ( isset( $this->prop[
'implicitgroups'] ) ) {
84 $vals[
'implicitgroups'] =
$user->getAutomaticGroups();
85 $result->setIndexedTagName( $vals[
'implicitgroups'],
'g' );
88 if ( isset( $this->prop[
'rights'] ) ) {
90 $vals[
'rights'] = array_values( array_unique(
$user->getRights() ) );
91 $result->setIndexedTagName( $vals[
'rights'],
'r' );
94 if ( isset( $this->prop[
'changeablegroups'] ) ) {
95 $vals[
'changeablegroups'] =
$user->changeableGroups();
96 $result->setIndexedTagName( $vals[
'changeablegroups'][
'add'],
'g' );
97 $result->setIndexedTagName( $vals[
'changeablegroups'][
'remove'],
'g' );
98 $result->setIndexedTagName( $vals[
'changeablegroups'][
'add-self'],
'g' );
99 $result->setIndexedTagName( $vals[
'changeablegroups'][
'remove-self'],
'g' );
102 if ( isset( $this->prop[
'options'] ) ) {
103 $vals[
'options'] =
$user->getOptions();
106 if ( isset( $this->prop[
'preferencestoken'] ) &&
108 $user->isAllowed(
'editmyoptions' )
113 if ( isset( $this->prop[
'editcount'] ) ) {
116 $vals[
'editcount'] = intval(
$user->getEditCount() );
119 if ( isset( $this->prop[
'ratelimits'] ) ) {
123 if ( isset( $this->prop[
'realname'] ) && !in_array(
'realname', $wgHiddenPrefs ) ) {
124 $vals[
'realname'] =
$user->getRealName();
127 if (
$user->isAllowed(
'viewmyprivateinfo' ) ) {
128 if ( isset( $this->prop[
'email'] ) ) {
129 $vals[
'email'] =
$user->getEmail();
130 $auth =
$user->getEmailAuthenticationTimestamp();
131 if ( !is_null( $auth ) ) {
137 if ( isset( $this->prop[
'registrationdate'] ) ) {
138 $regDate =
$user->getRegistration();
139 if ( $regDate !==
false ) {
144 if ( isset( $this->prop[
'acceptlang'] ) ) {
145 $langs = $this->
getRequest()->getAcceptLang();
146 $acceptLang =
array();
147 foreach ( $langs
as $lang => $val ) {
148 $r =
array(
'q' => $val );
152 $result->setIndexedTagName( $acceptLang,
'lang' );
153 $vals[
'acceptlang'] = $acceptLang;
162 if ( !
$user->isPingLimitable() ) {
167 $categories =
array();
168 if (
$user->isAnon() ) {
169 $categories[] =
'anon';
171 $categories[] =
'user';
173 if (
$user->isNewbie() ) {
174 $categories[] =
'ip';
175 $categories[] =
'subnet';
176 if ( !
$user->isAnon() ) {
177 $categories[] =
'newbie';
180 $categories = array_merge( $categories,
$user->getGroups() );
184 foreach ( $wgRateLimits
as $action => $limits ) {
185 foreach ( $categories
as $cat ) {
186 if ( isset( $limits[$cat] ) && !is_null( $limits[$cat] ) ) {
187 $retval[$action][$cat][
'hits'] = intval( $limits[$cat][0] );
188 $retval[$action][$cat][
'seconds'] = intval( $limits[$cat][1] );
224 'What pieces of information to include',
225 ' blockinfo - Tags if the current user is blocked, by whom, and for what reason',
226 ' hasmsg - Adds a tag "message" if the current user has pending messages',
227 ' groups - Lists all the groups the current user belongs to',
228 ' implicitgroups - Lists all the groups the current user is automatically a member of',
229 ' rights - Lists all the rights the current user has',
230 ' changeablegroups - Lists the groups the current user can add to and remove from',
231 ' options - Lists all preferences the current user has set',
232 ' preferencestoken - Get a token to change current user\'s preferences',
233 ' editcount - Adds the current user\'s edit count',
234 ' ratelimits - Lists all rate limits applying to the current user',
235 ' realname - Adds the user\'s real name',
236 ' email - Adds the user\'s email address and email authentication date',
237 ' acceptlang - Echoes the Accept-Language header sent by ' .
238 'the client in a structured format',
239 ' registrationdate - Adds the user\'s registration date',
252 'blockinfo' =>
array(
257 'blockedby' =>
array(
261 'blockedbyid' =>
array(
265 'blockedreason' =>
array(
271 'messages' =>
'boolean'
273 'preferencestoken' =>
array(
274 'preferencestoken' =>
'string'
276 'editcount' =>
array(
277 'editcount' =>
'integer'
287 'emailauthenticated' =>
array(
292 'registrationdate' =>
array(
293 'registrationdate' =>
array(
302 return 'Get information about the current user.';
307 'api.php?action=query&meta=userinfo',
308 'api.php?action=query&meta=userinfo&uiprop=blockinfo|groups|rights|hasmsg',
313 return 'https://www.mediawiki.org/wiki/API:Meta#userinfo_.2F_ui';
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
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
static setContent(&$arr, $value, $subElemName=null)
Adds a content element to an array.
__construct( $query, $moduleName)
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Query module to get information about the currently logged-in user.
getResult()
Get the result object.
getRequest()
Get the WebRequest object.
getUser()
Get the User object.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getExamples()
Returns usage examples for this module.
This is a base class for all Query modules.
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getParamDescription()
Returns an array of parameter descriptions.
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
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
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
getModuleName()
Get the name of the module being executed by this instance.
getMain()
Get the main module.
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
getDescription()
Returns the description string for this module.
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