Updated 9 files and added 2 files (automated)
parent
c675ed5bd7
commit
8c5a018b92
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 96 960 960" width="48" fill="#000000"><path d="M278 779q-84.583 0-143.792-59.191Q75 660.618 75 576.059t59.208-143.809Q193.417 373 278 373h404q84.583 0 143.792 59.191Q885 491.382 885 575.941T825.792 719.75Q766.583 779 682 779H278Zm.286-35H682q68.875 0 118.438-49.001Q850 645.998 850 575.911q0-70.086-49.562-118.999Q750.875 408 682 408H278.286q-70.168 0-119.227 48.965Q110 505.929 110 575.965 110 646 159.059 695t119.227 49Zm-.227-67q42.524 0 71.733-29.15Q379 618.701 379 576.059q0-42.642-29.15-71.851Q320.701 475 278.176 475q-42.524 0-72.35 29.15Q176 533.299 176 575.941q0 42.642 29.767 71.851Q235.534 677 278.059 677ZM480 576Z"/></svg>
|
After Width: | Height: | Size: 698 B |
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
header("Content-Type: application/json");
|
||||
$requests = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/../kiosk.json"), true);
|
||||
|
||||
$data = [
|
||||
"success" => false
|
||||
];
|
||||
|
||||
function encode($string) {
|
||||
return preg_replace("/[^a-zA-Z0-9.]/m", "", base64_encode($string));
|
||||
}
|
||||
|
||||
if (isset($_GET["id"]) && isset($_GET["key"]) && in_array($_GET["id"], array_map(function ($i) { return $i["id"]; }, $requests))) {
|
||||
foreach ($requests as $index => $request) {
|
||||
if ($request["id"] === $_GET["id"] && $request["key"] === $_GET["key"] && time() - strtotime($request["date"]) < 60) {
|
||||
$data["success"] = true;
|
||||
|
||||
$token = encode(openssl_random_pseudo_bytes(128));
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/../tokens/" . $token, json_encode([
|
||||
"user" => $request["user"],
|
||||
"date" => date('c')
|
||||
]));
|
||||
|
||||
$requests[$index]["token"] = false;
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/../kiosk.json", json_encode($requests, JSON_PRETTY_PRINT));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
die(json_encode($data, JSON_PRETTY_PRINT));
|
Loading…
Reference in New Issue