From: kkalev Date: Wed, 12 Mar 2003 15:57:57 +0000 (+0000) Subject: Call gethostbyaddr with an @ in front to suppress error messages X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=042282b08c953bdb6248a597f6f1a915e807abd4;p=freeradius-dialup-admin.git Call gethostbyaddr with an @ in front to suppress error messages --- diff --git a/Changelog b/Changelog index 02f4645..d6bfcba 100644 --- a/Changelog +++ b/Changelog @@ -58,6 +58,7 @@ Ver 1.62: on the data in the totacct table. * Add a few comments in the tot_stats and monthly_tot_stats scripts * Add support for ! in usernames in log_badlogins +* Call gethostbyaddr with an @ in front to suppress error messages Ver 1.61: * Add a string encoder for greek * If general_decode_normal_attributes is set then encode attributes in lib/ldap/change_info. In the near future diff --git a/htdocs/failed_logins.php3 b/htdocs/failed_logins.php3 index 028ca99..1e6f8e2 100644 --- a/htdocs/failed_logins.php3 +++ b/htdocs/failed_logins.php3 @@ -106,7 +106,7 @@ if ($link){ $acct_server = $da_name_cache[$acct_server]; if (!isset($acct_server)){ $acct_server = $row[NASIPAddress]; - $acct_server = gethostbyaddr($acct_server); + $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'); diff --git a/htdocs/user_accounting.php3 b/htdocs/user_accounting.php3 index ca07432..37a8229 100644 --- a/htdocs/user_accounting.php3 +++ b/htdocs/user_accounting.php3 @@ -109,7 +109,7 @@ if ($link){ if ($acct_server != ''){ $acct_server = $da_name_cache[$row[NASIPAddress]]; if (!isset($acct_server)){ - $acct_server = gethostbyaddr($row[NASIPAddress]); + $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'); diff --git a/htdocs/user_admin.php3 b/htdocs/user_admin.php3 index 5a1ef99..cbb5d67 100644 --- a/htdocs/user_admin.php3 +++ b/htdocs/user_admin.php3 @@ -183,8 +183,8 @@ if ($link){ $lastlog_session_time_jvs = 1000 * $lastlog_session_time; $lastlog_session_time = time2strclock($lastlog_session_time); $lastlog_client_ip = $row['FramedIPAddress']; - $lastlog_server_name = gethostbyaddr($lastlog_server_ip); - $lastlog_client_name = gethostbyaddr($lastlog_client_ip); + $lastlog_server_name = @gethostbyaddr($lastlog_server_ip); + $lastlog_client_name = @gethostbyaddr($lastlog_client_ip); $lastlog_callerid = $row['CallingStationId']; if ($lastlog_callerid == '') $lastlog_callerid = 'not available'; @@ -215,8 +215,8 @@ if ($link){ $lastlog_server_port = $row['NASPortId']; $lastlog_session_time = time2str($row['AcctSessionTime']); $lastlog_client_ip = $row['FramedIPAddress']; - $lastlog_server_name = ($lastlog_server_ip != '') ? gethostbyaddr($lastlog_server_ip) : '-'; - $lastlog_client_name = ($lastlog_client_ip != '') ? gethostbyaddr($lastlog_client_ip) : '-'; + $lastlog_server_name = ($lastlog_server_ip != '') ? @gethostbyaddr($lastlog_server_ip) : '-'; + $lastlog_client_name = ($lastlog_client_ip != '') ? @gethostbyaddr($lastlog_client_ip) : '-'; $lastlog_callerid = $row['CallingStationId']; if ($lastlog_callerid == '') $lastlog_callerid = 'not available'; diff --git a/htdocs/user_stats.php3 b/htdocs/user_stats.php3 index 620d13b..1892bb1 100644 --- a/htdocs/user_stats.php3 +++ b/htdocs/user_stats.php3 @@ -111,7 +111,7 @@ if ($link){ $acct_download = bytes2str($acct_download); $acct_server = $da_name_cache[$row[NASIPAddress]]; if (!isset($acct_server)){ - $acct_server = gethostbyaddr($row[NASIPAddress]); + $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');