diff options
author | Simon Rettberg | 2020-09-21 11:30:14 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-09-21 11:30:14 +0200 |
commit | e12a02856e49ce3f18bc49080dd442bed06e868e (patch) | |
tree | 145a91681a770dbfa7a77bc052e39f108c5da7b1 /modules-available/statistics/pages/list.inc.php | |
parent | [Module] Add phpdoc (diff) | |
download | slx-admin-e12a02856e49ce3f18bc49080dd442bed06e868e.tar.gz slx-admin-e12a02856e49ce3f18bc49080dd442bed06e868e.tar.xz slx-admin-e12a02856e49ce3f18bc49080dd442bed06e868e.zip |
[statistics] Show if current runmode is different from configured one
This isn't accounting for fake runmodes like "remoteaccess" or "exams",
which aren't stored in the database, but actually, this might be
beneficial, as you want to actually see if the clients are in this mode.
Diffstat (limited to 'modules-available/statistics/pages/list.inc.php')
-rw-r--r-- | modules-available/statistics/pages/list.inc.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules-available/statistics/pages/list.inc.php b/modules-available/statistics/pages/list.inc.php index 2dab152d..9f2df897 100644 --- a/modules-available/statistics/pages/list.inc.php +++ b/modules-available/statistics/pages/list.inc.php @@ -40,7 +40,8 @@ class SubPage } } $res = Database::simpleQuery("SELECT m.machineuuid, m.locationid, m.macaddr, m.clientip, m.lastseen, - m.logintime, m.state, m.currentuser, m.realcores, m.mbram, m.kvmstate, m.cpumodel, m.id44mb, m.hostname, m.notes IS NOT NULL AS hasnotes, + m.logintime, m.state, m.currentuser, m.currentrunmode, m.realcores, m.mbram, m.kvmstate, m.cpumodel, m.id44mb, + m.hostname, m.notes IS NOT NULL AS hasnotes, m.badsectors, Count(s.machineuuid) AS confvars $xtra FROM machine m LEFT JOIN setting_machine s USING (machineuuid) $join WHERE $where GROUP BY m.machineuuid", $args); @@ -101,6 +102,16 @@ class SubPage unset($row['currentuser']); } } + if ($row['state'] === 'IDLE' || $row['state'] === 'OCCUPIED') { + if ((!empty($row['currentrunmode']) || !empty($row['rmmodule'])) + && $row['currentrunmode'] !== $row['rmmodule']) { + $row['wrongRunMode'] = true; + if (!empty($row['currentrunmode'])) { + $wrongModule = Module::get($row['currentrunmode']); + $row['currentrunmode'] = $wrongModule === false ? $row['currentrunmode'] : $wrongModule->getDisplayName(); + } + } + } $row['state_' . $row['state']] = true; if ($row['locationid'] > 0) { $row['location'] = $location[$row['locationid']]; |