Files
web-installer/signin.php
laci ad2b3afa3c
Some checks failed
continuous-integration/drone/push Build is failing
auth
2025-12-10 19:34:30 +00:00

28 lines
532 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
session_start();
$content = file_get_contents("/tmp/.htpasswd");
$arr = explode(":",$content);
$user = $arr[0];
$pass_hash = trim($arr[1]);
if ($user == $_POST["AUTH_USERNAME"]) {
$pass_input = trim($_POST["AUTH_PASSWORD"]);
if (password_verify($pass_input, $pass_hash)) {
//echo "OK jelszó jó!";
$_SESSION["username"] = $_POST["AUTH_USERNAME"];
} else {
//echo "ROSSZ jelszó hibás!";
unset($_SESSION["username"]);
}
header('Location: manage.html');
}
else header('Location: signin.html');
?>