mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-23 02:19:07 +01:00
Compare commits
2 commits
c0d8f9f81a
...
e23ee2f209
Author | SHA1 | Date | |
---|---|---|---|
|
e23ee2f209 | ||
|
75258d9744 |
5 changed files with 3577 additions and 3557 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,6 +64,12 @@ 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');
|
||||
|
@ -112,13 +118,14 @@ function getEntryAccessLog($dn) {
|
|||
'attributes' => array(
|
||||
'reqStart',
|
||||
'reqEnd',
|
||||
'reqAuthzID',
|
||||
'reqType',
|
||||
'reqResult',
|
||||
'reqMessage',
|
||||
'reqMod',
|
||||
'reqOld',
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
if (!is_array($data)) {
|
||||
return;
|
||||
|
@ -151,7 +158,7 @@ function getEntryAccessLogPage($dn, $page = false, $nbByPage = 30) {
|
|||
'logs' => array_slice(
|
||||
$_SESSION['entryAccessLogPages'][$dn],
|
||||
$page > 1 ? (($page - 1) * $nbByPage) - 1 : 0,
|
||||
$nbByPage,
|
||||
$nbByPage
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -193,6 +200,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,6 +7,7 @@
|
|||
<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>
|
||||
|
@ -16,6 +17,7 @@
|
|||
{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