mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
LSaddon::accesslog: Fix PHP < 7.3 compatibility
This commit is contained in:
parent
c0d8f9f81a
commit
75258d9744
1 changed files with 4 additions and 4 deletions
|
@ -54,7 +54,7 @@ function LSaddon_accesslog_support() {
|
||||||
'getEntryAccessLog',
|
'getEntryAccessLog',
|
||||||
'cli_getEntryAccessLog',
|
'cli_getEntryAccessLog',
|
||||||
'Get entry access log',
|
'Get entry access log',
|
||||||
'[entry DN] [page]',
|
'[entry DN] [page]'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -118,7 +118,7 @@ function getEntryAccessLog($dn) {
|
||||||
'reqMod',
|
'reqMod',
|
||||||
'reqOld',
|
'reqOld',
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
if (!is_array($data)) {
|
if (!is_array($data)) {
|
||||||
return;
|
return;
|
||||||
|
@ -151,7 +151,7 @@ function getEntryAccessLogPage($dn, $page = false, $nbByPage = 30) {
|
||||||
'logs' => array_slice(
|
'logs' => array_slice(
|
||||||
$_SESSION['entryAccessLogPages'][$dn],
|
$_SESSION['entryAccessLogPages'][$dn],
|
||||||
$page > 1 ? (($page - 1) * $nbByPage) - 1 : 0,
|
$page > 1 ? (($page - 1) * $nbByPage) - 1 : 0,
|
||||||
$nbByPage,
|
$nbByPage
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -193,6 +193,6 @@ function cli_getEntryAccessLog($command_args) {
|
||||||
$page = isset($command_args[1]) ? intval($command_args[1]) : 1;
|
$page = isset($command_args[1]) ? intval($command_args[1]) : 1;
|
||||||
echo json_encode(
|
echo json_encode(
|
||||||
getEntryAccessLogPage($dn, $page),
|
getEntryAccessLogPage($dn, $page),
|
||||||
JSON_PRETTY_PRINT,
|
JSON_PRETTY_PRINT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue