Call gethostbyaddr with an @ in front to suppress error messages
authorkkalev <kkalev>
Wed, 12 Mar 2003 15:57:57 +0000 (15:57 +0000)
committerkkalev <kkalev>
Wed, 12 Mar 2003 15:57:57 +0000 (15:57 +0000)
dialup_admin/Changelog
dialup_admin/htdocs/failed_logins.php3
dialup_admin/htdocs/user_accounting.php3
dialup_admin/htdocs/user_admin.php3
dialup_admin/htdocs/user_stats.php3

index 02f4645..d6bfcba 100644 (file)
@@ -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
index 028ca99..1e6f8e2 100644 (file)
@@ -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');
index ca07432..37a8229 100644 (file)
@@ -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');
index 5a1ef99..cbb5d67 100644 (file)
@@ -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';
index 620d13b..1892bb1 100644 (file)
@@ -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');