LSaddon::accesslog: show events author

This commit is contained in:
Benjamin Renard 2022-07-20 14:56:16 +02:00
parent 75258d9744
commit e23ee2f209
5 changed files with 3573 additions and 3553 deletions

View file

@ -64,6 +64,12 @@ function mapAccessLogEntry(&$entry) {
$attrs = $entry['attrs']; $attrs = $entry['attrs'];
$entry['start'] = LSldap::parseDate(LSldap::getAttr($attrs, 'reqStart')); $entry['start'] = LSldap::parseDate(LSldap::getAttr($attrs, 'reqStart'));
$entry['end'] = LSldap::parseDate(LSldap::getAttr($attrs, 'reqEnd')); $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['type'] = LSldap::getAttr($attrs, 'reqType');
$entry['result'] = ldap_err2str(LSldap::getAttr($attrs, 'reqResult')); $entry['result'] = ldap_err2str(LSldap::getAttr($attrs, 'reqResult'));
$entry['message'] = LSldap::getAttr($attrs, 'reqMessage'); $entry['message'] = LSldap::getAttr($attrs, 'reqMessage');
@ -112,6 +118,7 @@ function getEntryAccessLog($dn) {
'attributes' => array( 'attributes' => array(
'reqStart', 'reqStart',
'reqEnd', 'reqEnd',
'reqAuthzID',
'reqType', 'reqType',
'reqResult', 'reqResult',
'reqMessage', 'reqMessage',

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,7 @@
<thead> <thead>
<tr> <tr>
<th>{tr msg="Date"}</th> <th>{tr msg="Date"}</th>
<th>{tr msg="Author"}</th>
<th>{tr msg="Operation"}</th> <th>{tr msg="Operation"}</th>
<th>{tr msg="Result"}</th> <th>{tr msg="Result"}</th>
<th>{tr msg="Details"}</th> <th>{tr msg="Details"}</th>
@ -16,6 +17,7 @@
{foreach $page.logs as $log} {foreach $page.logs as $log}
<tr> <tr>
<td>{$log.start->format('Y/m/d H:i:s')}</td> <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.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 class="center">{$log.result}{if $log.message} <img class='LStips' src="{img name='help'}" alt="?" title='{$log.message|escape:quotes}'/>{/if}</td>
<td> <td>