From f5325b58528c351c265f4c66be4511bf00af2a8c Mon Sep 17 00:00:00 2001 From: kirillius Date: Fri, 10 Jan 2025 02:47:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20ap?= =?UTF-8?q?i=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/api/API.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/api/API.php b/plugins/api/API.php index aeaa10a..f35b590 100644 --- a/plugins/api/API.php +++ b/plugins/api/API.php @@ -10,6 +10,12 @@ class API extends Plugin $this->config["key"] = sha1(rand() . uniqid()); $this->context->getConfig()->save(); } + + $headers = getallheaders(); + + if ($headers and isset($headers["X-Auth"]) and $headers["X-Auth"] == md5($this->config["key"])) { + $_SESSION["auth"] = true; + } } public function getKey(): string