| Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.php |
| — | — | @@ -113,7 +113,7 @@ |
| 114 | 114 | $wgOnlineStatusBar_AwayTime = 15; |
| 115 | 115 | |
| 116 | 116 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'OnlineStatusBarHooks::ckSchema'; |
| 117 | | -$wgHooks['UserLogoutComplete'][] = 'OnlineStatusBarHooks::logout'; |
| | 117 | +$wgHooks['UserLogout'][] = 'OnlineStatusBarHooks::logout'; |
| 118 | 118 | $wgHooks['ArticleViewHeader'][] = 'OnlineStatusBarHooks::renderBar'; |
| 119 | 119 | $wgHooks['UserLoginComplete'][] = 'OnlineStatusBarHooks::updateStatus'; |
| 120 | 120 | $wgHooks['GetPreferences'][] = 'OnlineStatusBarHooks::preferencesHook'; |
| Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php |
| — | — | @@ -28,15 +28,13 @@ |
| 29 | 29 | * @param $old_name string |
| 30 | 30 | * @return bool |
| 31 | 31 | */ |
| 32 | | - public static function logout( &$user, &$inject_html, $old_name ) { |
| | 32 | + public static function logout( &$user ) { |
| 33 | 33 | global $wgOnlineStatusBarDefaultEnabled; |
| 34 | 34 | // check if user had enabled this feature before we write to db |
| 35 | | - $olduser = User::newFromName( $old_name ); |
| 36 | | - if ( $olduser instanceof User ) { |
| 37 | | - if ( $olduser->getOption( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ) ) { |
| 38 | | - OnlineStatusBar::purge( $old_name ); |
| 39 | | - OnlineStatusBar_StatusCheck::deleteStatus( $old_name ); |
| 40 | | - } |
| | 35 | + if ( $user->getOption( 'OnlineStatusBar_active', $wgOnlineStatusBarDefaultEnabled ) ) { |
| | 36 | + $userName->getName(); |
| | 37 | + OnlineStatusBar::purge( $userName ); |
| | 38 | + OnlineStatusBar_StatusCheck::deleteStatus( $userName ); |
| 41 | 39 | } |
| 42 | 40 | return true; |
| 43 | 41 | } |