예제 #1
0
파일: mini.php 프로젝트: hank/nzbgetweb
        $logpage = (int) $_COOKIE['c_logpage'];
    }
}
$postlogpage = 0;
if (isset($_REQUEST['postlogpage'])) {
    $postlogpage = $_REQUEST['postlogpage'];
    SetCookie("c_postlogpage", $postlogpage, 0);
} else {
    if (isset($_COOKIE['c_postlogpage'])) {
        $postlogpage = (int) $_COOKIE['c_postlogpage'];
    }
}
if (isset($_REQUEST['start']) && $ServerStartCommand != '') {
    SetCookie("c_start", 1, 0);
}
$RpcApi = GetAvailableApi();
//echo "<!-- API: $RpcApi -->\n";
if (!isset($RpcApi)) {
    echo "NZBGetWeb: Could not find required extension or library. Consult README-file for installation instructions.";
    exit(-1);
}
if (count($_GET) > 0) {
    Redirect($LoginRedirectPage);
}
$wantstart = false;
$connected = false;
$phpvars = null;
if (isset($_COOKIE['c_start']) && $ServerStartCommand != '') {
    SetCookie("c_start", "", time() - 10000);
    // delete cookie
    $wantstart = true;
예제 #2
0
    SetCookie('c_logpage', $logpage, 0);
} else {
    if (isset($_COOKIE['c_logpage'])) {
        $logpage = (int) $_COOKIE['c_logpage'];
    }
}
$postlogpage = 0;
if (isset($_REQUEST['postlogpage'])) {
    $postlogpage = $_REQUEST['postlogpage'];
    SetCookie("c_postlogpage", $postlogpage, 0);
} else {
    if (isset($_COOKIE['c_postlogpage'])) {
        $postlogpage = (int) $_COOKIE['c_postlogpage'];
    }
}
$rpc_api = GetAvailableApi();
//echo "<!-- API: $rpc_api -->\n";
if (!isset($rpc_api)) {
    echo 'NZBGetWeb: Could not find required extension or library. Consult README-file for installation instructions.';
    exit(-1);
}
$editpostparamid = 0;
if (isset($_REQUEST['editpostparam'])) {
    $editpostparamid = $_REQUEST['id'];
}
$wantstart = false;
$connected = false;
$supportpostparam = $PostProcessConfigTemplate != '' && $PostProcessConfigFile != '';
$phpvars = null;
if (isset($_REQUEST['start']) && $ServerStartCommand != '') {
    $wantstart = true;
예제 #3
0
function GetMultiRequest($methodarr)
{
    global $ServerIp, $ServerPort, $ServerPassword;
    $RpcApi = GetAvailableApi();
    if ($RpcApi == 'json-rpc-ext') {
        return GetMultiRequest_JsonRpc_Ext($ServerIp, $ServerPort, $ServerPassword, $methodarr);
    } else {
        if ($RpcApi == 'json-rpc-lib') {
            return GetMultiRequest_JsonRpc_Lib($ServerIp, $ServerPort, $ServerPassword, $methodarr);
        } else {
            if ($RpcApi == 'xml-rpc-ext') {
                return GetMultiRequest_XmlRpc_Ext($ServerIp, $ServerPort, $ServerPassword, $methodarr);
            } else {
                if ($RpcApi == 'xml-rpc-lib') {
                    return GetMultiRequest_XmlRpc_Lib($ServerIp, $ServerPort, $ServerPassword, $methodarr);
                } else {
                    if ($RpcApi == 'none') {
                        return 'ERROR: Could not detect available RPC-API: old PHP version or modules missing. See README for details.';
                    } else {
                        return 'ERROR: Invalid value for option "rpc_api"';
                    }
                }
            }
        }
    }
}