Exemplo n.º 1
0
//
$si = intval(GET('index'));
$sensors = isset($_SESSION['sensors'][$si]) ? $_SESSION['sensors'][$si] : "";
$type = GET('type');
$location = base64_decode(GET('location'));
ossim_valid($location, OSS_ALPHA, OSS_PUNC_EXT, 'illegal: location');
ossim_valid($sensors, OSS_ALPHA, OSS_PUNC, 'illegal: sensors');
ossim_valid($type, OSS_DIGIT, 'illegal: type');
if (ossim_error()) {
    die(ossim_error());
}
require_once 'ossim_db.inc';
$db = new ossim_db();
$conn = $db->connect();
$networks = array();
$nets = Wireless::get_wireless_aps_networks($conn, $type, $sensors);
if ($type == 1) {
    // only networks with cloaked Yes and No
    foreach ($nets as $ne) {
        $yes = $no = 0;
        foreach ($ne['aps'] as $mac => $arr) {
            if ($arr['cloaked'] == 'No') {
                $no = 1;
            }
            if ($arr['cloaked'] == 'Yes') {
                $yes = 1;
            }
        }
        if ($yes && $no) {
            $networks[] = $ne;
        }