config["key"])) { $this->generateNewKey(); } $headers = getallheaders(); if ($headers and isset($headers["X-Auth"]) and $headers["X-Auth"] == md5($this->config["key"])) { $_SESSION["auth"] = true; } } public function generateNewKey(): string { $this->config["key"] = sha1(rand() . uniqid()); $this->saveConfig(); return $this->config["key"]; } public function getKey(): string { return $this->config["key"]; } }