diff --git a/header.php b/header.php index c72c1d58..00ad7932 100644 --- a/header.php +++ b/header.php @@ -1,14 +1,29 @@ 0) { - $auth = true; - $pwstring = "auth=".$pwhash; + // Password set + if($_POST["pw"] == $webpw || $_GET["auth"] == $pwhash) + { + // Password (POST) correct or hash (GET) correct + $auth = true; + $pwstring = "auth=".$pwhash; + } + else + { + // Password or hash wrong + $auth = false; + $pwstring = ""; + } } else { - $auth = false; + // No password set + $auth = true; + $pwstring = ""; } if (isset($_GET['enable']) && $auth) { @@ -212,11 +227,13 @@ + 0) { ?>