Files
furatalog-web/admin/login.php
T
2025-07-19 16:14:26 +02:00

62 lines
1.9 KiB
PHP

<?php
require_once("/var/www/furatalog/data/script/furatalog.sessions.php");
$fs = new furatalogSessions();
if (isset($_GET["ref"])) {
//$_SESSION["ref"] = $_GET["ref"];
$fs->setSessionData("ref", $_GET["ref"]);
}
if (isset($_POST["username"]) && isset($_POST["password"])) {
if ($_POST["username"] == "SiskelDev" && password_verify($_POST["password"], "\$2y\$10\$uhkbDXtndzyDKsJh7d14HOBE7JoWiqYQPx3r88xDhWHnL9W4t4OJa")) {
//$_SESSION["login"] = "true-as-hell";
$fs->setSessionData("login", "true-as-hell");
//$redirect = isset($_SESSION["ref"]) ? $_SESSION["ref"] : "index";
$redirect = !($fs->getSessionData("ref") == null) ? $fs->getSessionData("ref") : "index";
//unset($_SESSION["ref"]);
$fs->unsetSessionData("ref");
header("Location: " . $redirect . ".php");
die();
}
}
/*if (isset($_SESSION["login"]) && $_SESSION["login"] == "true-as-hell") {
header("Location: index.php");
die();
}*/
if (!($fs->getSessionData("login") == null) && ($fs->getSessionData("login") == "true-as-hell")) {
header("Location: index.php");
die();
}
?>
<!DOCTYPE html>
<html>
<head>
<?php echo file_get_contents("/var/www/furatalog-cdn/mainHead.html"); ?>
<title>Admin Login</title>
<style>
html, body {
margin: 0;
height: 100%;
padding: 0;
}
</style>
</head>
<body>
<div class="login-container">
<a class="backbutton" href="/">← Back to Furatalog</a>
<h1>Admin Login</h1>
<p>Please login to access the admin panel.</p>
<br>
<form action="login.php" method="post">
<input type="text" name="username" placeholder="Username" autoComplete='off'>
<input type="password" name="password" placeholder="Password" autoComplete='off'>
<input type="submit" value="Login">
</form>
</div>
</body>
</html>