Created Custom Session System and Updated Admin Section to new System

This commit is contained in:
2025-07-19 15:57:10 +02:00
parent 1c73557ae4
commit faa65803f2
8 changed files with 188 additions and 11 deletions
+14 -5
View File
@@ -1,5 +1,6 @@
<?php
session_start();
require_once("/var/www/furatalog/data/script/furatalog.sessions.php");
$fs = new furatalogSessions();
if (isset($_GET["ref"])) {
$_SESSION["ref"] = $_GET["ref"];
@@ -7,17 +8,25 @@ if (isset($_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";
$redirect = isset($_SESSION["ref"]) ? $_SESSION["ref"] : "index";
unset($_SESSION["ref"]);
//$_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") {
/*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: login.php");
die();
}
?>