Files
furatalog-web/admin/login.php
T

53 lines
1.6 KiB
PHP
Raw Normal View History

2025-05-20 12:21:13 +02:00
<?php
require_once("/var/www/furatalog/data/script/furatalog.sessions.php");
$fs = new furatalogSessions();
2025-05-20 12:21:13 +02:00
if (isset($_GET["ref"])) {
2025-07-19 16:14:26 +02:00
$fs->setSessionData("ref", $_GET["ref"]);
2025-05-20 12:21:13 +02:00
}
if (isset($_POST["username"]) && isset($_POST["password"])) {
if ($_POST["username"] == "SiskelDev" && password_verify($_POST["password"], "\$2y\$10\$uhkbDXtndzyDKsJh7d14HOBE7JoWiqYQPx3r88xDhWHnL9W4t4OJa")) {
$fs->setSessionData("login", "true-as-hell");
2025-07-19 16:25:27 +02:00
$redirect = $fs->issetSessionData("ref") ? $fs->getSessionData("ref") : "index";
$fs->unsetSessionData("ref");
2025-05-20 12:21:13 +02:00
header("Location: " . $redirect . ".php");
die();
}
}
if ($fs->issetSessionData("login") && ($fs->getSessionData("login") == "true-as-hell")) {
2025-07-19 16:08:42 +02:00
header("Location: index.php");
die();
2025-05-20 12:21:13 +02:00
}
?>
<!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>