if (preg_match("~$search~i", $row['name'])) { $descriptions[$row['id']] = escape_js(trans('Name').': '.$row['name']); continue; } if (preg_match("~$search~i", $row['ip'])) { $descriptions[$row['id']] = trans('IP').': '.$row['ip']; continue; } if (preg_match("~$search~i", $row['ip_pub'])) { $descriptions[$row['id']] = trans('IP').': '.$row['ip_pub']; continue; } if (preg_match("~".macformat($search)."~i", $row['mac'])) { $macs = explode(',', $row['mac']); foreach ($macs as $mac) { if (preg_match("~".macformat($search)."~i", $mac)) { $descriptions[$row['id']] = trans('MAC').': '.$mac; } } if (count($macs) > 1) { $descriptions[$row['id']] .= ',...'; } continue; } $descriptions[$row['id']] = ''; } header('Content-type: text/plain'); if ($eglible) { print "this.eligible = [\"".implode('","',$eglible)."\"];\n"; print "this.descriptions = [\"".implode('","',$descriptions)."\"];\n"; print "this.actions = [\"".implode('","',$actions)."\"];\n";
$SESSION->save('nodesearch', $nodesearch); } if (!isset($_GET['o'])) { $SESSION->restore('nslo', $o); } else { $o = $_GET['o']; } $SESSION->save('nslo', $o); if (!isset($_POST['k'])) { $SESSION->restore('nslk', $k); } else { $k = $_POST['k']; } $SESSION->save('nslk', $k); // MAC address reformatting $nodesearch['mac'] = macformat($nodesearch['mac']); $LMS->InitXajax(); if (isset($_GET['search'])) { $LMS->RegisterXajaxFunction('connect_nodes'); $SMARTY->assign('xajax', $LMS->RunXajax()); $layout['pagetitle'] = trans('Nodes Search Results'); $nodelist = $LMS->GetNodeList($o, $nodesearch, $k); $listdata['total'] = $nodelist['total']; $listdata['order'] = $nodelist['order']; $listdata['direction'] = $nodelist['direction']; $listdata['totalon'] = $nodelist['totalon']; $listdata['totaloff'] = $nodelist['totaloff']; unset($nodelist['total']); unset($nodelist['order']); unset($nodelist['direction']); unset($nodelist['totalon']);
------------------------------------------------------------------ Description/Details: Used to display detailed information of a particular client. ================================================================== */ // Debugging... 1 for on, 0 for off. $debug = 0; // Require these again as we're going to be loaded into a div. require 'snsp.config.php'; require 'functions.sys.php'; require 'listservers.sys.php'; require 'adconnector.sys.php'; require 'dbconnector.sys.php'; // Get the device ID passed from GET. $l_device = $_GET['details']; $l_device_mac = macformat($l_device); if ($debug == 1) { echo '<p>QUERY BUILD START '; echo date('g:i:s'); echo '</p>'; } // Debug details. // Set up the first bit of the LAN query. $l_lan_query_pfx = "SELECT id, username, nasportid, ldapuserdescription, sathtagid, macoui, callingstationid, nasipaddress,\n\t\t\t\t\t\t\tnasidentifier, tunnelprivategroup, egressvlanid, reply, debugrejectinformation, authdate\n\t\t\t\t\t\t\tFROM (SELECT * FROM"; // Set up the first bit of the WLAN query. $l_wlan_query_pfx = "SELECT id, username, ldapuserdescription, sathtagid, eaptype, macoui, certexpirydate,\n\t\t\t\t\t\t\tcallingstationid, nasipaddress, nasidentifier, calledstationid, reply, ssid, \n\t\t\t\t\t\t\tdebugrejectinformation, authdate FROM (SELECT * FROM"; // ..and the last bit. $l_query_sfx = "USE INDEX(macindex) WHERE callingstationid='{$l_device_mac}') AS mytable \n\t\t\t\t\t\t\tWHERE mytable.authdate BETWEEN NOW() - INTERVAL 7 DAY AND NOW()\n\t\t\t\t\t\t\tORDER BY id DESC LIMIT 10"; // Set up the query arrays... $sql_query_lan = array(); $sql_query_wlan = array();