This commit is contained in:
Jokob-sk
2023-02-25 13:24:24 +11:00
parent d0d9a1a65d
commit 3392a1f17c

View File

@@ -2,6 +2,8 @@
require dirname(__FILE__).'/php/server/init.php';
require 'php/templates/security.php';
if ($Pia_WebProtection != 'true')
{
header('Location: devices.php');
@@ -9,6 +11,15 @@ if ($Pia_WebProtection != 'true')
exit;
}
// Logout
if (isset ($_GET["action"]) && $_GET["action"] == 'logout')
{
setcookie("PiAlert_SaveLogin", '', time()+1); // reset cookie
$_SESSION["login"] = 0;
header('Location: index.php');
exit;
}
// Password without Cookie check -> pass and set initial cookie
if (isset ($_POST["loginpassword"]) && $Pia_Password == hash('sha256',$_POST["loginpassword"]))
{