From: kkalev Date: Thu, 4 Jul 2002 08:06:36 +0000 (+0000) Subject: Check if the last logged in server and client ip are valid before calling gethostbyaddr X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=270ca1656254e621b32fe15ea2044cce1cbd75db;p=freeradius-dialup-admin.git Check if the last logged in server and client ip are valid before calling gethostbyaddr --- diff --git a/Changelog b/Changelog index 7af8c41..4e7634c 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ Ver 1.30: * Fix a small bug in user_admin.php3. * Pass the whole password as salt in da_encrypt() in password_check.php3 * Refresh the online users page every 50 secs. Patch by Alexandre Strube +* Check if the last logged in server and client ip are valid before calling gethostbyaddr Ver 1.29: * Add general_ld_library_path directive and set LD_LIBRARY_PATH accordingly (used in snmpfinger and radaclient). diff --git a/htdocs/user_admin.php3 b/htdocs/user_admin.php3 index 56fed37..1366275 100644 --- a/htdocs/user_admin.php3 +++ b/htdocs/user_admin.php3 @@ -197,8 +197,8 @@ if ($link){ $lastlog_server_port = $row['NASPortId']; $lastlog_session_time = time2str($row['AcctSessionTime']); $lastlog_client_ip = $row['FramedIPAddress']; - $lastlog_server_name = gethostbyaddr($lastlog_server_ip); - $lastlog_client_name = 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_input = $row['AcctInputOctets']; $lastlog_input = bytes2str($lastlog_input); $lastlog_output = $row['AcctOutputOctets'];