Пример #1
0
<?php

require_once "../sdk/httprequest.php";
$config = json_decode(file_get_contents("../data/ajaxconfig.json"), true);
$url = $config["url"];
$username = $_POST["username"];
$reqbody = "password="******"password"]);
$req = new JackzhengHttpRequest();
$req->setApiEndpoint($config["requestapi"]);
$res = $req->runRequest($url, "/users/{$username}/authtoken", "POST", $reqbody, "{}", 5739, "http");
echo json_encode($res);
Пример #2
0
<?php

require_once "../sdk/httprequest.php";
require_once "../include/loginstatus.php";
if ($loggedin) {
    $config = json_decode(file_get_contents("../data/ajaxconfig.json"), true);
    $url = $config["url"];
    $idkey = $_GET["idkey"];
    $req = new JackzhengHttpRequest();
    $req->setApiEndpoint($config["requestapi"]);
    $res = $req->runRequest($url, "/jobs/{$idkey}", "GET", "", "{}", 5738, "http");
    $res = json_decode($res["data"], true);
    echo json_encode($res);
}
Пример #3
0
<?php

require_once "../sdk/httprequest.php";
require_once "../include/loginstatus.php";
if ($loggedin) {
    $config = json_decode(file_get_contents("../data/ajaxconfig.json"), true);
    $url = $config["url"];
    $idkey = $_POST["idkey"];
    $codetype = $_POST["codetype"];
    $code = $_POST["code"];
    $req = new JackzhengHttpRequest();
    $req->setApiEndpoint($config["requestapi"]);
    $res = $req->runRequest($url, "/jobs/{$idkey}/codes/{$codetype}", "PUT", rawurlencode($code), "{}", 5738, "http");
    $res = json_decode($res["data"], true);
    echo json_encode($res);
}
Пример #4
0
<?php

require_once "../sdk/httprequest.php";
$config = json_decode(file_get_contents("../data/ajaxconfig.json"), true);
$url = $config["url"];
$jobId = $_POST["idkey"];
$connectionIdentifier = $_POST["connid"];
$status = $_POST["status"];
$result = rawurlencode($_POST["result"]);
$req = new JackzhengHttpRequest();
$req->setApiEndpoint($config["requestapi"]);
$res = $req->runRequest($url, "/jobs/{$jobId}/computenodes/{$connectionIdentifier}", "PUT", "status={$status}&result={$result}", "{}", 5738, "http");
echo $res["data"];
<?php

require_once "../sdk/httprequest.php";
$config = json_decode(file_get_contents("../data/ajaxconfig.json"), true);
$url = $config["url"];
$jobId = $_POST["idkey"];
$req = new JackzhengHttpRequest();
$req->setApiEndpoint($config["requestapi"]);
$res = $req->runRequest($url, "/jobs/{$jobId}/computenodes", "POST", "", "{}", 5738, "http");
echo $res["data"];
Пример #6
0
<?php

require_once "../sdk/httprequest.php";
$config = json_decode(file_get_contents("../data/ajaxconfig.json"), true);
$url = $config["url"];
$username = $_COOKIE["uname"];
$token = $_COOKIE["tk"];
$req = new JackzhengHttpRequest();
$req->setApiEndpoint($config["requestapi"]);
$res = $req->runRequest($url, "/users/{$username}/authtoken/{$token}", "GET", "", "{}", 5739, "http");
$res = json_decode($res["data"], true);
if ($res["validuntil"] > time()) {
    echo "valid";
} else {
    echo "notvalid";
}
//echo json_encode($res);