fixes #2450 add user agent in activities performed with api key

Updated user activity display to show when a user is connected via API key, including an icon and updated tooltip. Modified backend to set a 'connected_with' flag in activity details when API key authentication is used.
This commit is contained in:
Linty
2025-11-18 15:48:42 +01:00
parent da2804db72
commit 31d8f4516c
2 changed files with 11 additions and 3 deletions

View File

@@ -603,6 +603,12 @@ function pwg_activity($object, $object_id, $action, $details=array())
$user_agent = strip_tags($_SERVER['HTTP_USER_AGENT']);
}
if (isset($_SESSION['connected_with']) and 'api_key' === $_SESSION['connected_with'] and isset($_SERVER['HTTP_USER_AGENT']))
{
$details['connected_with'] = 'api_key';
$user_agent = strip_tags($_SERVER['HTTP_USER_AGENT']);
}
// we want to know if the login is automatic with remember_me (auto_login)
// or with an authentication key provided in the URL (auth_key_login)
if ('user' == $object and 'login' == $action)