summaryrefslogtreecommitdiff
path: root/includes/classes
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-10-17 12:24:14 +0000
committerfisharebest <fisharebest@gmail.com>2010-10-17 12:24:14 +0000
commit0722097bcba1b9e381584ca16d72f9bf4c793660 (patch)
tree1d5a6656698ff3f74ea0bd9e3db8bfe4a178065e /includes/classes
parent8b2ce20586a65fb3becd66f4493931914a2f20e4 (diff)
downloadwebtrees-0722097bcba1b9e381584ca16d72f9bf4c793660.tar.gz
webtrees-0722097bcba1b9e381584ca16d72f9bf4c793660.tar.bz2
webtrees-0722097bcba1b9e381584ca16d72f9bf4c793660.zip
Use sessions to determine logged-in users, rather than trying to maintain a list.
Diffstat (limited to 'includes/classes')
-rw-r--r--includes/classes/class_stats.php14
1 files changed, 1 insertions, 13 deletions
diff --git a/includes/classes/class_stats.php b/includes/classes/class_stats.php
index e3d87ab11f..f810952d96 100644
--- a/includes/classes/class_stats.php
+++ b/includes/classes/class_stats.php
@@ -3493,13 +3493,6 @@ class stats {
///////////////////////////////////////////////////////////////////////////////
static function _usersLoggedIn($type='nolist') {
- // Log out inactive users
- foreach (get_idle_users(time() - get_site_setting('SESSION_TIME')) as $user_id=>$user_name) {
- if ($user_id != WT_USER_ID) {
- userLogout($user_id);
- }
- }
-
$content = '';
// List active users
$NumAnonymous = 0;
@@ -3560,11 +3553,6 @@ class stats {
}
static function _usersLoggedInTotal($type='all') {
- foreach (get_idle_users(time() - get_site_setting('SESSION_TIME')) as $user_id=>$user_name) {
- if ($user_id != WT_USER_ID) {
- userLogout($user_id);
- }
- }
$anon = 0;
$visible = 0;
$x = get_logged_in_users();
@@ -3612,7 +3600,7 @@ class stats {
case 'loggedin':
if(is_array($params) && isset($params[0]) && $params[0] != ''){$yes = $params[0];}else{$yes = i18n::translate('Yes');}
if(is_array($params) && isset($params[1]) && $params[1] != ''){$no = $params[1];}else{$no = i18n::translate('No');}
- return get_user_setting($user_id, 'loggedin') ? $yes : $no;
+ return WT_DB::prepare("SELECT 1 FROM `##session` WHERE user_id=? LIMIT 1")->execute(array($user_id))->fetchOne() ? $yes : $no;
}
}