From fd510cf68906fd0d53a1e6f5a4dc5ba7a72d1121 Mon Sep 17 00:00:00 2001 From: Abhishek Pai Date: Tue, 30 Jul 2024 13:33:31 +0200 Subject: [PATCH] #128: Changed Action and Result to readable messages. Added link to User. Trimmed CN to only display user. --- conf/config.inc.php | 4 ++-- htdocs/auditlog.php | 1 - lang/en.inc.php | 16 +++++++--------- templates/listing_table.tpl | 7 +++++++ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/conf/config.inc.php b/conf/config.inc.php index 04ebe3d..adf9ef8 100644 --- a/conf/config.inc.php +++ b/conf/config.inc.php @@ -184,9 +184,9 @@ $audit_log_items = array('date','ip','dn','done_by','action','result','comment'); $audit_log_title = "date"; $audit_log_sortby = "date"; -$audit_log_linkto = array("user_dn"); +$audit_log_linkto = array("dn"); $audit_log_show_undefined = true; -$audit_log_truncate_value_after = 50; +$audit_log_truncate_value_after = 10; #$header_name_audit_admin = "AUTH_USER"; # Debug mode diff --git a/htdocs/auditlog.php b/htdocs/auditlog.php index dbdec2b..9381e5b 100644 --- a/htdocs/auditlog.php +++ b/htdocs/auditlog.php @@ -6,7 +6,6 @@ require_once("../lib/audit.inc.php"); #TODO: Order based on newest to oldest -#TODO: Highlight user with Name and link rather than full CN #TODO: Test comments and results to appear correctly $entries = array(); diff --git a/lang/en.inc.php b/lang/en.inc.php index ab890b8..4c0da12 100644 --- a/lang/en.inc.php +++ b/lang/en.inc.php @@ -34,12 +34,17 @@ $messages['pager_all'] = "All"; $messages['print_all'] = "Print all results"; $messages['print_page'] = "Print this page"; +$messages['label_action'] = "Action"; $messages['label_authtimestamp'] = "Last authentication"; $messages['label_businesscategory'] = "Business category"; $messages['label_carlicense'] = "Car license"; +$messages['label_comment'] = "Comment"; $messages["label_created"] = "Created"; +$messages['label_date'] = "Date"; $messages['label_description'] = "Description"; $messages['label_displayname'] = "Display name"; +$messages['label_dn'] = "User"; +$messages['label_done_by'] = "Done By"; $messages['label_employeenumber'] = "Employee number"; $messages['label_employeetype'] = "Employee type"; $messages['label_expirationdate'] = "Expiration date"; @@ -47,6 +52,7 @@ $messages['label_firstname'] = "First name"; $messages['label_fullname'] = "Full name"; $messages['label_identifier'] = "Identifier"; +$messages['label_ip'] = "IP Address"; $messages['label_l'] = "Locality"; $messages['label_lastname'] = "Last name"; $messages['label_mail'] = "Mail"; @@ -65,19 +71,11 @@ $messages['label_pwdfailuretime'] = "Last authentication failures"; $messages['label_pwdpolicysubentry'] = "Associated password policy"; $messages['label_pwdreset'] = "Reset password at next connection"; +$messages['label_result'] = "Result"; $messages['label_secretary'] = "Secretary"; $messages['label_state'] = "State"; $messages['label_street'] = "Street"; $messages['label_title'] = "Title"; - -$messages['label_date'] = "Date"; -$messages['label_ip'] = "IP Address"; -$messages['label_dn'] = "User"; -$messages['label_done_by'] = "Done By"; -$messages['label_action'] = "Action"; -$messages['label_result'] = "Result"; -$messages['label_comment'] = "Comment"; - $messages['ldaperror'] = "LDAP communication error"; $messages['lockaccount'] = "Lock account"; $messages['lockedaccounts'] = "Locked accounts"; diff --git a/templates/listing_table.tpl b/templates/listing_table.tpl index e74e73e..31a14c6 100644 --- a/templates/listing_table.tpl +++ b/templates/listing_table.tpl @@ -42,8 +42,15 @@ {/if} {/if} {if $display == "audit"} + {if $column == "result" or $column == "action"} + {$msg_{$entry.$column}} + {elseif $column == "dn"} + + {{$entry.$column|regex_replace:"/(cn=)/":""}|regex_replace:"/(,ou=.*)/":""} + {else} {$entry.$column} {/if} + {/if} {/foreach}