function Disable()
{
    $uuid = $_POST["uuid"];
    $meta = new mysql_meta();
    if (intval($_POST["gpid"]) > 0) {
        if (!$meta->CreateOrder_group(intval($_POST["gpid"]), "PROXY_ENABLE_URGENCY", array())) {
            echo "Failed\nFunction:" . __FUNCTION__ . "\nLine:" . __LINE__ . "\nFile:" . basename(__FILE__);
        }
        return;
    }
    if (!$meta->CreateOrder($uuid, "PROXY_ENABLE_URGENCY", array())) {
        echo "Failed\nFunction:" . __FUNCTION__ . "\nLine:" . __LINE__ . "\nFile:" . basename(__FILE__);
    }
}
示例#2
0
function manager_password_save()
{
    $uuid = $_POST["uuid"];
    $gpid = $_POST["gpid"];
    $password = url_decode_special_tool($_POST["change_password"]);
    $username = $_POST["change_admin"];
    $meta = new mysql_meta();
    $ARRAY["USER"] = $username;
    $ARRAY["PASS"] = $password;
    $value = base64_encode(serialize($ARRAY));
    if ($gpid > 0) {
        if (!$meta->CreateOrder_group($gpid, "MANAGER_CREDS", array("VALUE" => $value))) {
            echo "Failed\nFunction:" . __FUNCTION__ . "\nLine:" . __LINE__ . "\nFile:" . basename(__FILE__);
        }
        return;
    }
    if (!$meta->CreateOrder($uuid, "MANAGER_CREDS", array("VALUE" => $value))) {
        echo "Failed\nFunction:" . __FUNCTION__ . "\nLine:" . __LINE__ . "\nFile:" . basename(__FILE__);
    }
}
function notify_proxies()
{
    $uuid = $_POST["uuid"];
    $gpid = intval($_POST["gpid"]);
    $meta = new mysql_meta();
    $sql = "SELECT * FROM `proxy_ports_wbl` WHERE groupid={$gpid}";
    $results = $meta->QUERY_SQL($sql);
    while ($ligne = mysql_fetch_assoc($results)) {
        $ID = $ligne["ID"];
        $array[$ID]["pattern"] = $ligne["pattern"];
        $array[$ID]["destport"] = $ligne["destport"];
        $array[$ID]["include"] = $ligne["include"];
    }
    if (!$meta->CreateOrder_group($gpid, "SQUID_TRANSPARENT_WBL", $array)) {
        echo "Failed\nFunction:" . __FUNCTION__ . "\nLine:" . __LINE__ . "\nFile:" . basename(__FILE__);
    }
}
function update_save()
{
    $q = new mysql_meta();
    if ($_GET["gpid"] > 0) {
        if (!$q->CreateOrder_group($_POST["update-uuid"], "INSTALL_SOFTWARE", array("FILENAME" => $_POST["filename"], "FILESIZE" => $_POST["SIZE"]), true)) {
            echo $q->mysql_error;
        }
        return;
    }
    if (!$q->CreateOrder($_POST["update-uuid"], "INSTALL_SOFTWARE", array("FILENAME" => $_POST["filename"], "FILESIZE" => $_POST["SIZE"]))) {
        echo $q->mysql_error;
    }
}
function update_save()
{
    $q = new mysql_meta();
    $gpid = $_POST["gpid"];
    if ($gpid > 0) {
        if (!$q->CreateOrder_group($gpid, "UPDATE_ARTICA", array("FILENAME" => $_POST["filename"], "FILETYPE" => $_POST["filetype"]))) {
            echo "Failed\nFunction:" . __FUNCTION__ . "\nLine:" . __LINE__ . "\nFile:" . basename(__FILE__);
        }
        return;
    }
    if (!$q->CreateOrder($_POST["update-uuid"], "UPDATE_ARTICA", array("FILENAME" => $_POST["filename"], "FILETYPE" => $_POST["filetype"]))) {
        echo $q->mysql_error;
    }
}