Demon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/60394


Change subject: Make it possible to disable Special:Activeusers
......................................................................

Make it possible to disable Special:Activeusers

Change-Id: I41b8263f16ca6aedb84e9595caf2b01261613699
---
M includes/DefaultSettings.php
M includes/SpecialPageFactory.php
M includes/specials/SpecialStatistics.php
3 files changed, 17 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/60394/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index da2f321..5335c80 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3572,6 +3572,12 @@
 $wgHitcounterUpdateFreq = 1;
 
 /**
+ * Whether to enable the Special:Activeusers special page.
+ * Some larger wikis may want to disable this for performance reasons.
+ */
+$wgEnableActiveUsersPage = true;
+
+/**
  * How many days user must be idle before he is considered inactive. Will 
affect
  * the number shown on Special:Statistics and Special:ActiveUsers special page.
  * You might want to leave this as the default value, to provide comparable
diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php
index 377db8f..fd91812 100644
--- a/includes/SpecialPageFactory.php
+++ b/includes/SpecialPageFactory.php
@@ -99,7 +99,6 @@
                'Listusers'                 => 'SpecialListUsers',
                'Listadmins'                => 'SpecialListAdmins',
                'Listbots'                  => 'SpecialListBots',
-               'Activeusers'               => 'SpecialActiveUsers',
                'Userrights'                => 'UserrightsPage',
                'EditWatchlist'             => 'SpecialEditWatchlist',
 
@@ -204,6 +203,10 @@
                                self::$mList['JavaScriptTest'] = 
'SpecialJavaScriptTest';
                        }
 
+                       if ( !$wgEnableActiveUsersPage ) {
+                               self::$mList['Activeusers'] = 
'SpecialActiveUsers';
+                       }
+
                        // Add extension special pages
                        self::$mList = array_merge( self::$mList, 
$wgSpecialPages );
 
diff --git a/includes/specials/SpecialStatistics.php 
b/includes/specials/SpecialStatistics.php
index dbf2f0d..94cdb28 100644
--- a/includes/specials/SpecialStatistics.php
+++ b/includes/specials/SpecialStatistics.php
@@ -164,18 +164,19 @@
        }
 
        private function getUserStats() {
-               global $wgActiveUserDays;
+               global $wgActiveUserDays, $wgEnableActiveUsersPage;
+
+               $activeUsersLink = !$wgEnableActiveUsersPage ? '' : ' ' .
+                       Linker::linkKnown( SpecialPage::getTitleFor( 
'Activeusers' ),
+                               $this->msg( 'listgrouprights-members' 
)->escaped() );
+
                return Xml::openElement( 'tr' ) .
                        Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( 
'statistics-header-users' )->parse() ) .
                        Xml::closeElement( 'tr' ) .
                                $this->formatRow( $this->msg( 
'statistics-users' )->parse(),
                                                
$this->getLanguage()->formatNum( $this->users ),
                                                array( 'class' => 
'mw-statistics-users' ) ) .
-                               $this->formatRow( $this->msg( 
'statistics-users-active' )->parse() . ' ' .
-                                                       Linker::linkKnown(
-                                                               
SpecialPage::getTitleFor( 'Activeusers' ),
-                                                               $this->msg( 
'listgrouprights-members' )->escaped()
-                                                       ),
+                               $this->formatRow( $this->msg( 
'statistics-users-active' )->parse() . $activeUsersLink,
                                                
$this->getLanguage()->formatNum( $this->activeUsers ),
                                                array( 'class' => 
'mw-statistics-users-active' ),
                                                'statistics-users-active-desc',

-- 
To view, visit https://gerrit.wikimedia.org/r/60394
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41b8263f16ca6aedb84e9595caf2b01261613699
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Demon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to