Fix login #312
This commit is contained in:
novgorodschi catalin
2026-06-30 08:24:37 +03:00
parent 2fc35729b4
commit f7594e3f81
+11 -11
View File
@@ -126,7 +126,7 @@ function __construct() {
if($maint['active'] == 1 && $this->access < 9) { if($maint['active'] == 1 && $this->access < 9) {
// evita loop infinit // evita loop infinit
if(strpos($_SERVER['PHP_SELF'], 'maintenance.php') === false) { if(strpos($_SERVER['PHP_SELF'], 'maintenance.php') === false) {
header('Location: /maintenance.php'); header('Location: maintenance.php');
exit; exit;
} }
} }
@@ -197,11 +197,11 @@ function __construct() {
$logging->addLoginLog($dbarray['id'], \App\Utils\IpResolver::getClientIp() ?? ($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0')); $logging->addLoginLog($dbarray['id'], \App\Utils\IpResolver::getClientIp() ?? ($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0'));
if ($dbarray['id'] == 1) { if ($dbarray['id'] == 1) {
header("Location: /nachrichten.php"); header("Location: nachrichten.php");
exit; exit;
} }
header("Location: /dorf1.php"); header("Location: dorf1.php");
exit; exit;
} }
@@ -265,7 +265,7 @@ function __construct() {
'nachrichten.php', 'logout.php', 'statistiken.php', 'nachrichten.php', 'logout.php', 'statistiken.php',
'rules.php', 'karte.php', 'karte2.php', 'spieler.php' 'rules.php', 'karte.php', 'karte2.php', 'spieler.php'
])) { ])) {
header('Location: /nachrichten.php'); header('Location: nachrichten.php');
exit; exit;
} }
} }
@@ -287,7 +287,7 @@ function __construct() {
if ($this->access == BANNED && if ($this->access == BANNED &&
!in_array(basename($_SERVER['PHP_SELF']), ['banned.php', 'nachrichten.php', 'rules.php'])) { !in_array(basename($_SERVER['PHP_SELF']), ['banned.php', 'nachrichten.php', 'rules.php'])) {
header('Location: /banned.php'); header('Location: banned.php');
exit; exit;
} }
} }
@@ -296,7 +296,7 @@ function __construct() {
if (($_SESSION['ok'] ?? null) == 2 && if (($_SESSION['ok'] ?? null) == 2 &&
basename($_SERVER['PHP_SELF']) != 'maintenance.php') { basename($_SERVER['PHP_SELF']) != 'maintenance.php') {
header('Location: /maintenance.php'); header('Location: maintenance.php');
exit; exit;
} }
} }
@@ -320,7 +320,7 @@ function __construct() {
) )
) )
) { ) {
header('Location: /winner.php'); header('Location: winner.php');
exit; exit;
} }
} }
@@ -335,7 +335,7 @@ function __construct() {
if (!count($this->villages)) { if (!count($this->villages)) {
$this->Logout(); $this->Logout();
header('Location: /login.php'); header('Location: login.php');
exit; exit;
} }
@@ -512,18 +512,18 @@ function __construct() {
if (!$this->logged_in) { if (!$this->logged_in) {
if (!in_array($page, $pagearray) || $page == "logout.php") { if (!in_array($page, $pagearray) || $page == "logout.php") {
header("Location: /login.php"); header("Location: login.php");
exit; exit;
} }
} else { } else {
if (in_array($page, $pagearray)) { if (in_array($page, $pagearray)) {
if (($this->uid ?? 0) == 1) { if (($this->uid ?? 0) == 1) {
header("Location: /nachrichten.php"); header("Location: nachrichten.php");
exit; exit;
} }
header("Location: /dorf1.php"); header("Location: dorf1.php");
exit; exit;
} }
} }