32 parent::__construct(
'Activeusers' );
46 $opts->add(
'username',
'' );
47 $opts->add(
'groups', [] );
48 $opts->add(
'excludegroups', [] );
53 $opts->fetchValuesFromRequest( $this->
getRequest() );
55 if ( $par !==
null ) {
56 $opts->setValue(
'username', $par );
60 $usersBody = $pager->getBody();
66 $pager->getNavigationBar() .
67 Html::rawElement(
'ul', [], $usersBody ) .
68 $pager->getNavigationBar()
71 $out->addWikiMsg(
'activeusers-noresult' );
82 foreach ( $groups
as $group ) {
83 $msg = htmlspecialchars( UserGroupMembership::getGroupName( $group ) );
91 if (
$req->getCheck(
'hidebots' ) ) {
92 $excludeDefault[] =
'bot';
94 if (
$req->getCheck(
'hidesysops' ) ) {
95 $excludeDefault[] =
'sysop';
101 'name' =>
'username',
102 'label-message' =>
'activeusers-from',
105 'type' =>
'multiselect',
109 'label-message' =>
'activeusers-groups',
113 'type' =>
'multiselect',
116 'name' =>
'excludegroups',
117 'label-message' =>
'activeusers-excludegroups',
119 'default' => $excludeDefault,
125 ->setFormIdentifier(
'specialactiveusers' )
127 ->setWrapperLegendMsg(
'activeusers' )
128 ->setSubmitTextMsg(
'activeusers-submit' )
133 ->displayForm(
false );
141 $days = $this->
getConfig()->get(
'ActiveUserDays' );
143 $intro = $this->
msg(
'activeusers-intro' )->numParams( $days )->parse();
147 $rcMax =
$dbr->selectField(
'recentchanges',
'MAX(rc_timestamp)',
'', __METHOD__ );
149 $cTime =
$dbr->selectField(
'querycache_info',
151 [
'qci_type' =>
'activeusers' ],
157 $rcMin =
$dbr->selectField(
'recentchanges',
'MIN(rc_timestamp)' );
158 $secondsOld = time() -
wfTimestamp( TS_UNIX, $rcMin );
160 if ( $secondsOld > 0 ) {
161 $intro .= $this->
msg(
'cachedspecial-viewing-cached-ttl' )
162 ->durationParams( $secondsOld )->parseAsBlock();
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Implements Special:Activeusers.
buildForm()
Generate and output the form.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getIntroText()
Return introductory message.
Parent class for all special pages.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
getPageTitle( $subpage=false)
Get a self-referential title object.
static getAllGroups()
Return the set of defined explicit groups.
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
this hook is for auditing only $req
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead & $formDescriptor
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 & $options
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