diff --git a/front/index.php b/front/index.php index 7789ccd6..60da5b2f 100644 --- a/front/index.php +++ b/front/index.php @@ -1,8 +1,9 @@ - pass and set initial cookie if ($Pia_Password == hash('sha256',$_POST["loginpassword"])) + { + header('Location: /pialert/devices.php'); + $_SESSION["login"] = 1; + if (isset($_POST['PWRemember'])) {setcookie("PiAler_SaveLogin", hash('sha256',$_POST["loginpassword"]), time()+604800);} + } + +// active Session or valid cookie (cookie not extends) +if (($_SESSION["login"] == 1) || ($Pia_Password == $_COOKIE["PiAler_SaveLogin"])) { header('Location: /pialert/devices.php'); $_SESSION["login"] = 1; } -if ($_SESSION["login"] == 1) - { - header('Location: /pialert/devices.php'); - } - +// no active session, cookie not checked if ($_SESSION["login"] != 1) { if (file_exists('../db/setting_darkmode')) {$ENABLED_DARKMODE = True;} if ($Pia_Password == '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92') { $login_info = 'Defaultpassword "123456" is still active'; $login_mode = 'danger'; + $login_display_mode = 'display: block;'; $login_headline = 'Password Alert!'; $login_icon = 'fa-ban'; } else { $login_mode = 'info'; + $login_display_mode = 'display: none;'; $login_headline = 'Password Information'; $login_icon = 'fa-info'; } @@ -122,24 +130,32 @@ if ($ENABLED_DARKMODE === True) {
-
+
- +
+
+ +
+ -
+ + +
-


./reset_password.sh

@@ -165,6 +181,16 @@ if ($ENABLED_DARKMODE === True) { increaseArea: '20%' /* optional */ }); }); + +function Passwordhinfo() { + var x = document.getElementById("myDIV"); + if (x.style.display === "none") { + x.style.display = "block"; + } else { + x.style.display = "none"; + } +} +