mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user