mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-23 02:19:07 +01:00
Compare commits
No commits in common. "e23ee2f2098759ecd5f7bd5872e75e63a42134f9" and "c0d8f9f81af17a85d837389a64a4b7305e04de1d" have entirely different histories.
e23ee2f209
...
c0d8f9f81a
5 changed files with 3559 additions and 3579 deletions
|
@ -54,7 +54,7 @@ function LSaddon_accesslog_support() {
|
|||
'getEntryAccessLog',
|
||||
'cli_getEntryAccessLog',
|
||||
'Get entry access log',
|
||||
'[entry DN] [page]'
|
||||
'[entry DN] [page]',
|
||||
);
|
||||
}
|
||||
return true;
|
||||
|
@ -64,12 +64,6 @@ function mapAccessLogEntry(&$entry) {
|
|||
$attrs = $entry['attrs'];
|
||||
$entry['start'] = LSldap::parseDate(LSldap::getAttr($attrs, 'reqStart'));
|
||||
$entry['end'] = LSldap::parseDate(LSldap::getAttr($attrs, 'reqEnd'));
|
||||
$entry['author_dn'] = LSldap::getAttr($attrs, 'reqAuthzID');
|
||||
$entry['author_rdn'] = (
|
||||
$entry['author_dn']?
|
||||
explode('=', explode(',', $entry['author_dn'])[0])[1]:
|
||||
null
|
||||
);
|
||||
$entry['type'] = LSldap::getAttr($attrs, 'reqType');
|
||||
$entry['result'] = ldap_err2str(LSldap::getAttr($attrs, 'reqResult'));
|
||||
$entry['message'] = LSldap::getAttr($attrs, 'reqMessage');
|
||||
|
@ -118,14 +112,13 @@ function getEntryAccessLog($dn) {
|
|||
'attributes' => array(
|
||||
'reqStart',
|
||||
'reqEnd',
|
||||
'reqAuthzID',
|
||||
'reqType',
|
||||
'reqResult',
|
||||
'reqMessage',
|
||||
'reqMod',
|
||||
'reqOld',
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
if (!is_array($data)) {
|
||||
return;
|
||||
|
@ -158,7 +151,7 @@ function getEntryAccessLogPage($dn, $page = false, $nbByPage = 30) {
|
|||
'logs' => array_slice(
|
||||
$_SESSION['entryAccessLogPages'][$dn],
|
||||
$page > 1 ? (($page - 1) * $nbByPage) - 1 : 0,
|
||||
$nbByPage
|
||||
$nbByPage,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -200,6 +193,6 @@ function cli_getEntryAccessLog($command_args) {
|
|||
$page = isset($command_args[1]) ? intval($command_args[1]) : 1;
|
||||
echo json_encode(
|
||||
getEntryAccessLogPage($dn, $page),
|
||||
JSON_PRETTY_PRINT
|
||||
JSON_PRETTY_PRINT,
|
||||
);
|
||||
}
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,6 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>{tr msg="Date"}</th>
|
||||
<th>{tr msg="Author"}</th>
|
||||
<th>{tr msg="Operation"}</th>
|
||||
<th>{tr msg="Result"}</th>
|
||||
<th>{tr msg="Details"}</th>
|
||||
|
@ -17,7 +16,6 @@
|
|||
{foreach $page.logs as $log}
|
||||
<tr>
|
||||
<td>{$log.start->format('Y/m/d H:i:s')}</td>
|
||||
<td class="center">{if $log.author_dn}<span title='{$log.author_dn|escape:quotes}' class='LStips'>{$log.author_rdn}</span>{/if}</td>
|
||||
<td class="center">{$log.type}</td>
|
||||
<td class="center">{$log.result}{if $log.message} <img class='LStips' src="{img name='help'}" alt="?" title='{$log.message|escape:quotes}'/>{/if}</td>
|
||||
<td>
|
||||
|
|
Loading…
Reference in a new issue