From 3e62833e496f2a6dd1ecd141a1d1edeab2f204ec Mon Sep 17 00:00:00 2001 From: kkalev Date: Tue, 1 Oct 2002 19:16:06 +0000 Subject: [PATCH] Fix a problem in failed_logins when NASIPAddress is not set. --- Changelog | 1 + htdocs/failed_logins.php3 | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Changelog b/Changelog index 0debab4..aaeb882 100644 --- a/Changelog +++ b/Changelog @@ -20,6 +20,7 @@ Ver 1.60: function for each online user so we now don't need to do a lot of calls to time() but only one. That should make user_finger somewhat faster. * Fix a small issue with the general_accounting_info_order +* Fix a problem in failed_logins when NASIPAddress is not set. Ver 1.59: * Small html fixes in user_edit.php3 and password.php3 * Show number of failed logins in the last 7 days in the user admin page diff --git a/htdocs/failed_logins.php3 b/htdocs/failed_logins.php3 index 45701f9..98aa17a 100644 --- a/htdocs/failed_logins.php3 +++ b/htdocs/failed_logins.php3 @@ -97,16 +97,23 @@ if ($link){ else $acct_login = "$acct_login"; $acct_time = $row[AcctStopTime]; - $acct_server = $da_name_cache[$row[NASIPAddress]]; - if (!isset($acct_server)){ - $acct_server = gethostbyaddr($row[NASIPAddress]); - if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ - $da_name_cache[$row[NASIPAddress]] = $acct_server; - session_register('da_name_cache'); + $acct_server = $row[NASIPAddress]; + if ($acct_server != ''){ + $acct_server = $da_name_cache[$acct_server]; + if (!isset($acct_server)){ + $acct_server = $row[NASIPAddress]; + $acct_server = gethostbyaddr($acct_server); + if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ + $da_name_cache[$row[NASIPAddress]] = $acct_server; + session_register('da_name_cache'); + } + else + $da_name_cache[$row[NASIPAddress]] = $acct_server; + } } - else - $da_name_cache[$row[NASIPAddress]] = $acct_server; } + else + $acct_server = '-'; $acct_server = "$acct_server:$row[NASPortId]"; $acct_terminate_cause = "$row[AcctTerminateCause]"; if ($acct_terminate_cause == '') -- 2.39.5