r100836 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100835‎ | r100836 | r100837 >
Date:18:37, 26 October 2011
Author:petrb
Status:deferred
Tags:
Comment:
customizable now
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -110,10 +110,23 @@
111111 global $wgOnlineStatusBarModes, $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarDefaultOnline, $wgDBname;
112112 $dbw = wfGetDB( DB_MASTER );
113113 OnlineStatusBar::DeleteOld();
 114+ $user = User::newFromName($userID);
 115+ if ($user == null)
 116+ {
 117+ //something is wrong
 118+ return $wgOnlineStatusBarDefaultOffline;
 119+ }
114120 $result = $dbw->selectField( 'online_status', 'username', array( 'username' => strtolower($userID) ), __METHOD__, array( 'limit 1', 'order by timestamp desc' ) );
115121 if ( $result )
116122 {
117 - return $wgOnlineStatusBarDefaultOnline;
 123+ $status = $user->getOption("OnlineStatusBar_status");
 124+ if ($status == null || $status == "")
 125+ {
 126+ return $wgOnlineStatusBarDefaultOnline;
 127+ } else
 128+ {
 129+ return $status;
 130+ }
118131 }
119132
120133 return $wgOnlineStatusBarDefaultOffline;

Status & tagging log