Merge pull request #49 from Nicolas01/ImproveLastLoginDate

Improve last login date
This commit is contained in:
shevabam 2017-03-21 20:13:43 +01:00 committed by GitHub
commit 4ce411b34e
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ $datas = array();
if ($Config->get('last_login:enable'))
{
if (!(exec('/usr/bin/lastlog --time 365 | /usr/bin/awk -F\' \' \'{ print $1";"$5, $4, $8, $6}\'', $users)))
if (!(exec('/usr/bin/lastlog --time 365 | awk \'{ printf $1";"; for (i=4; i<NF; i++) printf $i" "; print $NF; }\'', $users)))
{
$datas[] = array(
'user' => 'N.A',
@ -30,4 +30,4 @@ if ($Config->get('last_login:enable'))
}
}
echo json_encode($datas);
echo json_encode($datas);