Fix users.php when user has multiple sessions

Signed-off-by: Moxie "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2022-08-10 16:04:46 -04:00
parent 0326c268b0
commit 74a60f6d9a
Signed by untrusted user: cobra
GPG Key ID: 4FD8F812083FF6F9
1 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@
<?php
$total = $on = 0;
$list = '';
$onlist = array();
$users = explode(' ', shell_exec('users /sshfs/var/run/utmp'));
$handle = opendir('/sshfs/home');
@ -17,10 +18,11 @@
if ($subdir != '.' && $subdir != '..') {
$is_online = false;
foreach ($users as $val)
if (trim($val) == $subdir) {
if (trim($val) == $subdir && !in_array($subdir, $onlist)) {
$online .= 'green';
$is_online = true;
$on++;
array_push($onlist, $subdir);
}
if (!$is_online) $online .= 'red';
$online .= '>•</span></b> ';