Example #1
0
if ($regex == 1) {
    regex_standard($_POST["api"], "../../../msg.php", $regex_extra);
    regex_standard($_GET["api"], "../../../msg.php", $regex_extra);
    regex_standard($_POST["token"], "../../../msg.php", $regex_extra);
    regex_standard($_GET["token"], "../../../msg.php", $regex_extra);
}
if (isset($_GET["token"])) {
    $token = $_GET["token"];
} else {
    include "../../../login_check.php";
    include "../../../config/config.php";
    $token = $api_token;
}
require "ws.php";
$ws = new WebService($token);
$ws->login();
$api = $_GET["api"];
$api = explode("/", $api);
// INTERFACES
if (sizeof($api) == 2 and $api[1] == "interface") {
    echo $ws->getAllInterfaces();
}
if (sizeof($api) == 3 and $api[1] == "interface") {
    echo $ws->getInterface($api[2]);
}
// CONFIG
if (sizeof($api) == 2 and $api[1] == "config") {
    //echo $ws->getConfig();
}
// CONFIG: GET IN|OUT
if (sizeof($api) == 4 and $api[1] == "config" and $api[2] == "io" and ($api[3] == "in" or $api[3] == "out")) {