forked from vern/website
Fix users.php when user has multiple sessions
Signed-off-by: Moxie "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
parent
0326c268b0
commit
74a60f6d9a
|
@ -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> ';
|
||||
|
|
Loading…
Reference in New Issue