auth
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-12-10 19:34:30 +00:00
parent 6e24eaf334
commit ad2b3afa3c
8 changed files with 112 additions and 4 deletions

27
signin.php Normal file
View File

@@ -0,0 +1,27 @@
<?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');
?>