mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
@@ -107,6 +107,13 @@ function __construct() {
|
||||
$this->access = $this->logged_in ? $database->getUserField($this->uid, "access", 1) : 0;
|
||||
}
|
||||
|
||||
// === IP BAN ENFORCEMENT (issue #185) - DUPA ce avem access ===
|
||||
// Admins / Multihunters are never blocked by an IP ban (avoid self-lockout).
|
||||
// The admin panel (Admin/admin.php) does not bootstrap Session, so it stays reachable.
|
||||
if ((int)$this->access < (defined('MULTIHUNTER') ? MULTIHUNTER : 8)) {
|
||||
\App\Utils\IpResolver::enforce($database);
|
||||
}
|
||||
|
||||
// === MAINTENANCE CHECK - DUPA ce avem access ===
|
||||
$maint = $database->getMaintenance();
|
||||
if($maint['active'] == 1 && $this->access < 9) {
|
||||
@@ -165,7 +172,7 @@ function __construct() {
|
||||
$database->updateUserField($user_sanitized, "sessid", $_SESSION['sessid'], 0);
|
||||
}
|
||||
|
||||
$logging->addLoginLog($dbarray['id'], $_SERVER['REMOTE_ADDR']);
|
||||
$logging->addLoginLog($dbarray['id'], \App\Utils\IpResolver::getClientIp() ?? ($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0'));
|
||||
|
||||
if ($dbarray['id'] == 1) {
|
||||
header("Location: nachrichten.php");
|
||||
|
||||
Reference in New Issue
Block a user