Skip to content

Commit ef7241f

Browse files
committed
[FIX] Last users highlight.
1 parent e275891 commit ef7241f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

manager/views/page/2.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
if ($activeUsers->count() < 1) {
129129
$html = '<p>[%no_active_users_found%]</p>';
130130
} else {
131-
$now = $modx->timestamp($_SERVER['REQUEST_TIME']);
131+
$now = evo()->now()->unix();
132132
if (extension_loaded('intl')) {
133133
// https://www.php.net/manual/en/class.intldateformatter.php
134134
// https://www.php.net/manual/en/datetime.createfromformat.php
@@ -162,17 +162,17 @@
162162
foreach ($activeUsers->get()->toArray() as $activeUser) {
163163
$userCount[$activeUser['internalKey']] = isset($userCount[$activeUser['internalKey']]) ? $userCount[$activeUser['internalKey']] + 1 : 1;
164164
165-
$idle = $activeUser['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
165+
$idle = ($activeUser['lasthit'] + evo()->getConfig('server_offset_time')) < $timetocheck ? ' class="userIdle"' : '';
166166
$webicon = $activeUser['internalKey'] < 0 ? '<i class="[&icon_globe&]"></i>' : '';
167167
$ip = $activeUser['ip'] === '::1' ? '127.0.0.1' : $activeUser['ip'];
168168
$currentaction = EvolutionCMS\Legacy\LogHandler::getAction($activeUser['action'], $activeUser['id']);
169169
if (extension_loaded('intl')) {
170170
// https://www.php.net/manual/en/class.intldateformatter.php
171171
// https://www.php.net/manual/en/datetime.createfromformat.php
172172
$formatter = new IntlDateFormatter(evolutionCMS()->getConfig('manager_language'), IntlDateFormatter::MEDIUM, IntlDateFormatter::MEDIUM, null, null, 'HH:mm:ss');
173-
$lasthit = $formatter->format($modx->timestamp($activeUser['lasthit']));
173+
$lasthit = $formatter->format(evo()->timestamp($activeUser['lasthit']));
174174
} else {
175-
$lasthit = date('H:i:s', $modx->timestamp($activeUser['lasthit']));
175+
$lasthit = date('H:i:s', evo()->timestamp($activeUser['lasthit']));
176176
}
177177
$userList[] = [$idle, '', $activeUser['username'], $webicon, abs($activeUser['internalKey']), $ip, $lasthit, $currentaction];
178178
}

0 commit comments

Comments
 (0)