Skip to content

Commit

Permalink
added forwarded for to auth log, as it is in imp/lib/Auth.php
Browse files Browse the repository at this point in the history
Signed-off-by: Rainer Bendig <hexathos@mailbox.org>
  • Loading branch information
Rainer Bendig authored and mrubinsk committed Feb 13, 2022
1 parent 7c7ae1d commit 1b6da84
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions login.php
Expand Up @@ -99,9 +99,10 @@ function _addAnchor($url, $type, $vars, $url_anchor = null)

Horde::log(
sprintf(
'User %s logged out of Horde (%s)',
'User %s logged out of Horde (%s)%s',
$registry->getAuth(),
$_SERVER['REMOTE_ADDR']
$_SERVER['REMOTE_ADDR'],
empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])'
),
'NOTICE'
);
Expand Down Expand Up @@ -155,10 +156,11 @@ function _addAnchor($url, $type, $vars, $url_anchor = null)
if ($auth->authenticate(Horde_Util::getPost('horde_user'), $auth_params)) {
Horde::log(
sprintf(
'Login success for %s to %s (%s)',
'Login success for %s to %s (%s)%s',
$registry->getAuth(),
($vars->app && $is_auth) ? $vars->app : 'horde',
$_SERVER['REMOTE_ADDR']
$_SERVER['REMOTE_ADDR'],
empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])'
),
'NOTICE'
);
Expand Down Expand Up @@ -190,10 +192,11 @@ function _addAnchor($url, $type, $vars, $url_anchor = null)

Horde::log(
sprintf(
'FAILED LOGIN for %s to %s (%s)',
'FAILED LOGIN for %s to %s (%s)%s',
$vars->horde_user,
($vars->app && $is_auth) ? $vars->app : 'horde',
$_SERVER['REMOTE_ADDR']
$_SERVER['REMOTE_ADDR'],
empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? '' : ' (forwarded for [' . $_SERVER['HTTP_X_FORWARDED_FOR'] . '])'
),
'ERR'
);
Expand Down

0 comments on commit 1b6da84

Please sign in to comment.