mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2026-06-19 14:18:56 -04:00
Add option to add custom title in header (esm:custom_title)
Last login : add option to enable or not Disk : add filesystem Disk : values are centered
This commit is contained in:
+18
-15
@@ -5,26 +5,29 @@ $Config = new Config();
|
||||
|
||||
$datas = array();
|
||||
|
||||
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk -F\' \' \'{ print $1";"$5, $4, $8, $6}\'', $users)))
|
||||
if ($Config->get('last_login:enable'))
|
||||
{
|
||||
$datas[] = array(
|
||||
'user' => 'N.A',
|
||||
'date' => 'N.A',
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$max = $Config->get('last_login:max');
|
||||
|
||||
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
||||
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk -F\' \' \'{ print $1";"$5, $4, $8, $6}\'', $users)))
|
||||
{
|
||||
list($user, $date) = explode(';', $users[$i]);
|
||||
|
||||
$datas[] = array(
|
||||
'user' => $user,
|
||||
'date' => $date,
|
||||
'user' => 'N.A',
|
||||
'date' => 'N.A',
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$max = $Config->get('last_login:max');
|
||||
|
||||
for ($i = 1; $i < count($users) && $i <= $max; $i++)
|
||||
{
|
||||
list($user, $date) = explode(';', $users[$i]);
|
||||
|
||||
$datas[] = array(
|
||||
'user' => $user,
|
||||
'date' => $date,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($datas);
|
||||
Reference in New Issue
Block a user