mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-25 23:04:53 +02:00
DirectorActivityLog: use IP when unauthenticated
This applies mostly to self service API
This commit is contained in:
parent
d97022bf88
commit
d92492d5a1
@ -57,6 +57,10 @@ class DirectorActivityLog extends DbObject
|
||||
$auth = Auth::getInstance();
|
||||
if ($auth->isAuthenticated()) {
|
||||
return $auth->getUser()->getUsername();
|
||||
} elseif (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
|
||||
return '<' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '>';
|
||||
} elseif (array_key_exists('REMOTE_ADDR', $_SERVER)) {
|
||||
return '<' . $_SERVER['REMOTE_ADDR'] . '>';
|
||||
} else {
|
||||
return '<unknown>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user