diff --git a/core/user_logs/app_config.php b/core/user_logs/app_config.php index 2be6cd2353..dabc76a7b1 100644 --- a/core/user_logs/app_config.php +++ b/core/user_logs/app_config.php @@ -40,6 +40,10 @@ $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid'; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'hostname'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['search_by'] = 'true'; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'timestamp'; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; diff --git a/core/user_logs/resources/classes/user_logs.php b/core/user_logs/resources/classes/user_logs.php index 4a4d32dfc5..fc74e7742f 100644 --- a/core/user_logs/resources/classes/user_logs.php +++ b/core/user_logs/resources/classes/user_logs.php @@ -70,6 +70,7 @@ if (!class_exists('user_logs')) { $array['user_logs'][0]["domain_uuid"] = $result['domain_uuid']; $array['user_logs'][0]["user_uuid"] = $result['user_uuid']; $array['user_logs'][0]["username"] = $result['username']; + $array['user_logs'][0]["hostname"] = gethostname(); $array['user_logs'][0]["type"] = 'login'; $array['user_logs'][0]["remote_address"] = $_SERVER['REMOTE_ADDR']; $array['user_logs'][0]["user_agent"] = $_SERVER['HTTP_USER_AGENT']; diff --git a/core/user_logs/user_logs.php b/core/user_logs/user_logs.php index 8a4d16a00b..d976ed7f8e 100644 --- a/core/user_logs/user_logs.php +++ b/core/user_logs/user_logs.php @@ -84,6 +84,9 @@ //get the session path $session_path = session_save_path(); +//get the server hostname + $hostname = gethostname(); + //get order and order by $order_by = $_GET["order_by"] ?? null; $order = $_GET["order"] ?? null; @@ -146,7 +149,8 @@ //get the list $sql = "select "; - $sql .= "user_log_uuid, "; + $sql .= "u.user_log_uuid, "; + $sql .= "u.hostname, "; $sql .= "u.domain_uuid, "; $sql .= "d.domain_name, "; $sql .= "to_char(timezone(:time_zone, timestamp), 'DD Mon YYYY') as date_formatted, "; @@ -240,6 +244,7 @@ } echo "