7 Commits

Author SHA1 Message Date
Ferywir 8c1a6ad05b fix(admin): render a proper error page instead of a blank page on denial [#299] (#307)
Issue #299: posting to an admin Mod (eg editBuildings.php) could show an
essentially blank page. The admin panel and the game share the same PHP
session, so a game logout (session_destroy) — or a mobile browser dropping the
session cookie / serving a cached form with a stale token — wipes the admin
session. The Mod then stopped on a bare die('<h1>Access Denied</h1>') (or the
403 die() in csrf_verify()), which renders as a blank/broken page outside the
panel.

Add a shared admin_deny() helper in GameEngine/Admin/csrf.php that renders a
clean, self-contained, styled error page (with a "Return to Admin Panel" link)
and a no-store header, then exits. Wire it into csrf_verify() and replace every
bare "Access Denied" die() across the 42 admin Mods. Each Mod now loads
csrf.php at the top so admin_deny() is available before its first access check.

This is the presentation fix Shadow asked for ("we must receive an error not
blank page"). The deeper root cause (admin and game sharing one PHP session) is
left for a follow-up: giving the admin panel its own session cookie name.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 10:25:18 +03:00
Ferywir e49069a9c6 fix(admin): verify CSRF token in player-management admin Mods [#139] (#256) 2026-06-23 06:54:03 +03:00
novgorodschi catalin 3fa16f13b2 Full Refactor Admin Panel & Logs
Full Refactor Admin Panel & Logs (now you can see detailed logs in admin panel) - ONLY BACKED
2026-05-22 11:29:37 +03:00
Martin Ambrus 7c67e1e7b9 fix: only 1 hero can exist and is deleted upon new hero training start
Closes #261
2017-11-02 11:05:26 +01:00
Martin Ambrus 331885a110 fix: remove SQL injections in Admin 2017-10-19 21:17:11 +02:00
uroskn 1afde368d3 GameEngine and install folders have 777 already set by default 2016-07-02 21:39:28 +02:00
Shadow 7cfa82a18d hero update 2014-03-18 07:35:37 +02:00