diff options
Diffstat (limited to 'modules-available/statistics/pages/machine.inc.php')
-rw-r--r-- | modules-available/statistics/pages/machine.inc.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/statistics/pages/machine.inc.php b/modules-available/statistics/pages/machine.inc.php index 87e8ad14..677ff580 100644 --- a/modules-available/statistics/pages/machine.inc.php +++ b/modules-available/statistics/pages/machine.inc.php @@ -36,7 +36,7 @@ class SubPage 'end' => $row['logintime'] + 300, )); $session = false; - while ($r = $res->fetch(PDO::FETCH_ASSOC)) { + foreach ($res as $r) { if ($session === false || abs($session['dateline'] - $row['logintime']) > abs($r['dateline'] - $row['logintime'])) { $session = $r; } @@ -201,7 +201,7 @@ class SubPage array('screen' => DeviceType::SCREEN, 'uuid' => $uuid)); $client['screens'] = array(); $ports = array(); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + foreach ($res as $row) { if ($row['disconnecttime'] != 0) continue; $ports[] = $row['connector']; @@ -227,7 +227,7 @@ class SubPage $spans['graph'] = ''; $last = false; $first = true; - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + foreach ($res as $row) { if (!$client['isclient'] && $row['typeid'] === Statistics::SESSION_LENGTH) continue; // Don't differentiate between session and idle for non-clients if ($first && $row['dateline'] > $cutoff && $client['lastboot'] > $cutoff) { @@ -325,7 +325,7 @@ class SubPage . ' WHERE machineuuid = :uuid ORDER BY logid DESC LIMIT 25', array('uuid' => $client['machineuuid'])); $count = 0; $log = array(); - while ($row = $lres->fetch(PDO::FETCH_ASSOC)) { + foreach ($lres as $row) { if (substr($row['description'], -5) === 'on :0' && strpos($row['description'], 'root logged') === false) { continue; } |