=".ip2long($cidr_range[0])." and User_auth.ip_int<=".ip2long($cidr_range[1]); } } $enabled_filter=''; if ($enabled>0) { if ($enabled===2) { $enabled_filter = ' and (User_auth.enabled=1 and User_list.enabled=1)'; } if ($enabled===1) { $enabled_filter = ' and (User_auth.enabled=0 or User_list.enabled=0)'; } } if (isset($_POST['ip'])) { $f_ip = $_POST['ip']; } if (!isset($f_ip) and isset($_SESSION[$page_url]['ip'])) { $f_ip=$_SESSION[$page_url]['ip']; } if (!isset($f_ip)) { $f_ip=''; } $_SESSION[$page_url]['ip']=$f_ip; $ip_list_type_filter=''; if ($ip_type>0) { //suspicious if ($ip_type===3) { $ip_list_type_filter = " and (User_auth.dhcp_action IN ('add', 'old', 'del') and (ABS(User_auth.dhcp_time - User_auth.last_found)>259200) and (UNIX_TIMESTAMP()-User_auth.last_found)<259200)"; } //dhcp if ($ip_type===2) { $ip_list_type_filter = " and (User_auth.dhcp_action IN ('add', 'old', 'del'))"; } //static if ($ip_type===1) { $ip_list_type_filter = " and (User_auth.dhcp_action NOT IN ('add', 'old', 'del'))"; } } $ip_where = ''; if (!empty($f_ip)) { if (checkValidIp($f_ip)) { $ip_where = " and ip_int=inet_aton('" . $f_ip . "') "; } if (empty($ip_where)) { $ip_where =" and (mac like '" . mac_dotted($f_ip) . "%' or comments like '".$f_ip."%' or dns_name like '".$f_ip."%' or dhcp_hostname like '".$f_ip."%')"; } $ip_list_filter = $ip_where; } else { $ip_list_filter = $ou_filter.$cidr_filter.$enabled_filter.$ip_list_type_filter; } print_ip_submenu($page_url); ?>