|
128 | 128 | if ($activeUsers->count() < 1) {
|
129 | 129 | $html = '<p>[%no_active_users_found%]</p>';
|
130 | 130 | } else {
|
131 |
| - $now = $modx->timestamp($_SERVER['REQUEST_TIME']); |
| 131 | + $now = evo()->now()->unix(); |
132 | 132 | if (extension_loaded('intl')) {
|
133 | 133 | // https://www.php.net/manual/en/class.intldateformatter.php
|
134 | 134 | // https://www.php.net/manual/en/datetime.createfromformat.php
|
|
162 | 162 | foreach ($activeUsers->get()->toArray() as $activeUser) {
|
163 | 163 | $userCount[$activeUser['internalKey']] = isset($userCount[$activeUser['internalKey']]) ? $userCount[$activeUser['internalKey']] + 1 : 1;
|
164 | 164 |
|
165 |
| - $idle = $activeUser['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
| 165 | + $idle = ($activeUser['lasthit'] + evo()->getConfig('server_offset_time')) < $timetocheck ? ' class="userIdle"' : ''; |
166 | 166 | $webicon = $activeUser['internalKey'] < 0 ? '<i class="[&icon_globe&]"></i>' : '';
|
167 | 167 | $ip = $activeUser['ip'] === '::1' ? '127.0.0.1' : $activeUser['ip'];
|
168 | 168 | $currentaction = EvolutionCMS\Legacy\LogHandler::getAction($activeUser['action'], $activeUser['id']);
|
169 | 169 | if (extension_loaded('intl')) {
|
170 | 170 | // https://www.php.net/manual/en/class.intldateformatter.php
|
171 | 171 | // https://www.php.net/manual/en/datetime.createfromformat.php
|
172 | 172 | $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'])); |
174 | 174 | } else {
|
175 |
| - $lasthit = date('H:i:s', $modx->timestamp($activeUser['lasthit'])); |
| 175 | + $lasthit = date('H:i:s', evo()->timestamp($activeUser['lasthit'])); |
176 | 176 | }
|
177 | 177 | $userList[] = [$idle, '', $activeUser['username'], $webicon, abs($activeUser['internalKey']), $ip, $lasthit, $currentaction];
|
178 | 178 | }
|
|
0 commit comments