r53778 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53777‎ | r53778 | r53779 >
Date:10:49, 26 July 2009
Author:purodha
Status:deferred
Tags:
Comment:
Add configurable option to show anymous online users, too.
Modified paths:
  • /trunk/extensions/WhosOnline/WhosOnline.php (modified) (history)
  • /trunk/extensions/WhosOnline/WhosOnlineSpecialPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WhosOnline/WhosOnlineSpecialPage.php
@@ -17,11 +17,15 @@
1818 }
1919
2020 function getQueryInfo() {
 21+ global $wgWhosOnlineShowAnons;
 22+
2123 return array (
2224 'tables' => array('online'),
2325 'fields' => array('username'),
2426 'options' => array('ORDER BY' => 'timestamp DESC'),
25 - 'conds' => array('userid != 0')
 27+ 'conds' => $wgWhosOnlineShowAnons
 28+ ? array()
 29+ : array('userid != 0')
2630 );
2731 }
2832
@@ -115,4 +119,4 @@
116120 $wgOut->addHTML($pager->getNavigationBar());
117121 $wgOut->addHTML('<ul>'.$body.'</ul>');
118122 }
119 -}
\ No newline at end of file
 123+}
Index: trunk/extensions/WhosOnline/WhosOnline.php
@@ -10,6 +10,8 @@
1111 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1212 */
1313
 14+$wgWhosOnlineShowAnons = FALSE; // Showing anonymous users IP addresses can be a security threat!
 15+
1416 $wgHooks['BeforePageDisplay'][] = 'wfWhosOnline_update_data';
1517
1618 $wgExtensionCredits['other'][] = array(

Status & tagging log