Esempio n. 1
0
    $width = filter_var($_GET['width'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $width = DFLT_WIDTH;
}
if (isset($_GET['height'])) {
    $height = filter_var($_GET['height'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $height = DFLT_HEIGHT;
}
if (isset($_GET['interval'])) {
    $interval = filter_var($_GET['interval'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $interval = DFLT_INTERVAL;
}
if (isset($_GET['ip'])) {
    $ip = sanitize_ip($_GET['ip']);
} else {
    exit(1);
}
if (isset($_GET['sensor_id'])) {
    $sensor_id = filter_var($_GET['sensor_id'], FILTER_SANITIZE_NUMBER_INT);
} else {
    exit(1);
}
if (isset($_GET['timestamp'])) {
    $timestamp = filter_var($_GET['timestamp'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $timestamp = time() - $interval + 0.05 * $interval;
}
//make sure just real tables can be accessed
if (isset($_GET['table']) && ($_GET['table'] == "bd_tx_total_log" || $_GET['table'] == "bd_tx_log" || $_GET['table'] == "bd_rx_total_log" || $_GET['table'] == "bd_rx_log")) {
Esempio n. 2
0
}
//Initialization
$AIP = "";
$protocol = "";
$port = "62201";
//Default port is 62201
$SIP = "";
$access_proto = "";
$access_port = "";
$RIJK = "";
$exec_result = '';
if (isset($_POST['submit'])) {
    $AIP = sanitize_ip($_POST['AIP']);
    $protocol = sanitize_protocol($_POST['protocol']);
    $port = sanitize_port($_POST['port']);
    $SIP = sanitize_ip($_POST['SIP']);
    $access_proto = sanitize_protocol($_POST['access_proto']);
    $access_port = sanitize_port($_POST['access_port']);
    $RIJK = sanitize_key($_POST['RIJK']);
    if ($resp->is_valid) {
        //captcha done
        if (all_set($_POST) == true) {
            //all inputs are set
            if (validate_all($_POST) == true) {
                //all inputs in valid form
                $res = execute($AIP, $SIP, $protocol, $port, $access_proto, $access_port, $RIJK);
                //All good, execute on inputs
                if ($res == true) {
                    $exec_result = '<div class="msg" style="font-size:small"><br/>The SPA packet was sent successfully!</div>';
                } else {
                    $exec_result = '<div class="msg" style="font-size:small"><br/>Error: An error occurred during the execution.</div>';
Esempio n. 3
0
// Get variables from url and set defaults
if (isset($_GET['sensor_id']) && $_GET['sensor_id'] != "none") {
    $sensor_id = filter_var($_GET['sensor_id'], FILTER_SANITIZE_NUMBER_INT);
}
if (isset($_GET['interval']) && $_GET['interval'] != "none") {
    $interval = filter_var($_GET['interval'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $interval = DFLT_INTERVAL;
}
if (isset($_GET['timestamp']) && $_GET['timestamp'] != "none") {
    $timestamp = filter_var($_GET['timestamp'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $timestamp = time() - $interval + 0.05 * $interval;
}
if (isset($_GET['subnet']) && $_GET['subnet'] != "none") {
    $subnet = sanitize_ip($_GET['subnet']);
}
if (isset($_GET['limit']) && $_GET['limit'] == "all") {
    $limit = "all";
} elseif (isset($_GET['limit']) && $_GET['limit'] != "none") {
    $limit = filter_var($_GET['limit'], FILTER_SANITIZE_NUMBER_INT);
} else {
    $limit = 20;
}
$db = ConnectDb();
?>

<form name="navigation" class="form-inline" method=get action=<?php 
echo $_SERVER['PHP_SELF'];
?>
>