Fix user logs only saving the type as login (#7709)

Needs to use the result and default to login
This commit is contained in:
Alex
2026-01-21 15:45:21 -07:00
committed by GitHub
parent 76a9944b2f
commit 8bdf2a0c86

View File

@@ -109,11 +109,10 @@ class user_logs {
$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]["type"] = $result['type'] ?? 'login';
$array['user_logs'][0]["remote_address"] = $_SERVER['REMOTE_ADDR'];
$array['user_logs'][0]["user_agent"] = $_SERVER['HTTP_USER_AGENT'];
$array['user_logs'][0]["session_id"] = session_id();
$array['user_logs'][0]["type"] = 'login';
if ($result["authorized"]) {
$array['user_logs'][0]["result"] = 'success';
} else {