Index: trunk/extensions/OnlineStatus/OnlineStatus.php |
— | — | @@ -27,6 +27,15 @@ |
28 | 28 | */ |
29 | 29 | $wgAllowAnyUserOnlineStatusFunction = true; |
30 | 30 | |
| 31 | +/** |
| 32 | + * New preferences for this extension |
| 33 | + */ |
| 34 | +$wgDefaultUserOptions['online'] = 'online'; |
| 35 | +$wgDefaultUserOptions['showonline'] = 0; |
| 36 | +$wgDefaultUserOptions['onlineonlogin'] = 1; |
| 37 | +$wgDefaultUserOptions['offlineonlogout'] = 1; |
| 38 | + |
| 39 | + |
31 | 40 | // FIXME: Should be a separate class file |
32 | 41 | class OnlineStatus { |
33 | 42 | |
— | — | @@ -226,14 +235,14 @@ |
227 | 236 | $radios[wfMsg( 'onlinestatus-toggle-' . $lev )] = $lev; |
228 | 237 | } |
229 | 238 | |
230 | | - $preferences['onlinestatusonlogin'] = |
| 239 | + $preferences['onlineonlogin'] = |
231 | 240 | array( |
232 | 241 | 'type' => 'toggle', |
233 | 242 | 'section' => 'misc', |
234 | 243 | 'label-message' => 'onlinestatus-pref-onlineonlogin', |
235 | 244 | ); |
236 | 245 | |
237 | | - $preferences['onlinestatusonlogoff'] = |
| 246 | + $preferences['offlineonlogout'] = |
238 | 247 | array( |
239 | 248 | 'type' => 'toggle', |
240 | 249 | 'section' => 'misc', |
— | — | @@ -263,7 +272,7 @@ |
264 | 273 | * Hook for UserLoginComplete |
265 | 274 | */ |
266 | 275 | static function UserLoginComplete( $user ){ |
267 | | - if( $user->getOption( 'offlineonlogout' ) ){ |
| 276 | + if( $user->getOption( 'onlineonlogin' ) ){ |
268 | 277 | $user->setOption( 'online', 'online' ); |
269 | 278 | $user->saveSettings(); |
270 | 279 | } |