53 Commits

Author SHA1 Message Date
Ferywir 827354a622 feat(admin): add transparent debug error-log mode
Add an admin-controlled debug mode that captures PHP errors of all
players into var/log/debug-players.log, to hunt remaining PHP 8.3 bugs
from real play sessions. Fully transparent to players: no redirect, no
gameplay change, errors are never displayed.

- DB: new debug_log table (one row), mirroring the maintenance pattern.
- Database: getDebugMode()/setDebugMode()/setDebugSettings(), defensive
  when the table is absent (no blank page).
- Session: register a custom error + shutdown handler when enabled; the
  handler runs even when php.ini error_reporting masks warnings/notices,
  so capture is complete without a Docker rebuild. Auto-disables after a
  configurable window.
- DebugErrorLogger: size-capped file with a single .log.1 rotation,
  honours the @ operator, never throws.
- Admin: new "Debug Error Log" page (levels, size cap, auto-off, on-page
  viewer, clear, download) + debugLog action mod.
- Menu: admin-only quick on/off widget (TZ_DEBUG_ON/OFF, EN/FR/RO).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 17:18:39 +03:00
Ferywir e498563555 fix: blank in-game help + untranslated profile after l10n (#189) (#191) 2026-06-09 17:48:16 +03:00
Ferywir 20804d9182 feat: IP ban support (#185) (#188) 2026-06-09 15:15:27 +03:00
TravianZ Patcher 421915f774 Add per-user language selection (issue #166)
The profile already had a language selector (Templates/Profile/preference.tpl)
that saved the choice into users.lang and $_SESSION['lang'], but the saved
preference was never used to actually load the language: every page loads
include("Lang/".LANG.".php") with the server-wide LANG constant, so changing
the language in the profile had no visible effect.

This wires it up:

- Introduce SERVER_LANG (the server default) and make LANG the EFFECTIVE
  display language, resolved from the player's saved preference
  ($_SESSION['lang']) with a fallback to SERVER_LANG
  (install/data/constant_format.tpl).
  SECURITY: the value is sanitized to [a-z_] and the target Lang/<x>.php
  file must exist, otherwise we fall back to the server default. This
  prevents Local File Inclusion via include("Lang/".LANG.".php").

- Seed $_SESSION['lang'] from users.lang on login (GameEngine/Session.php,
  PopulateVar), so the chosen language applies right after logging in.

- Keep the SERVER default intact when an admin saves settings: the admin
  config regenerators and the "Server Settings"/config displays now use
  SERVER_LANG (the server default) instead of the per-user LANG, so an
  admin browsing in their own language can't accidentally overwrite the
  server default (6 Admin/Mods/edit*.php + editServerSet.tpl + config.tpl).

Note: existing installs must also add SERVER_LANG + the LANG resolution to
their generated GameEngine/config.php (and the Admin/Mods/constant_format.tpl
copy) since config is generated at install time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 09:07:57 +02:00
novgorodschi catalin a4e2c506a8 Redesign Admin Panel
Full frontend & backend redesign and refactor
2026-05-25 10:23:39 +03:00
novgorodschi catalin 05bfde9063 Remove some unused code and some fix
Remove some unused code and some fix
2026-05-21 13:12:21 +03:00
Catalin Novgorodschi 35467b93ec Incremental Refactor Session
Incremental Refactor Session
2026-05-13 14:01:33 +03:00
Catalin Novgorodschi 260896570e Revert "vulnerability fixed and cleanup and refactor"
This reverts commit 2a44e76414.
2026-02-11 15:22:16 +02:00
Catalin Novgorodschi 2a44e76414 vulnerability fixed and cleanup and refactor 2026-02-11 15:11:43 +02:00
Hubert Walczak e859bdde9a Delete session debug test lines 2023-08-14 17:26:12 +02:00
Hubert Walczak 5d7f12ed87 Removed debug 2023-07-10 08:14:11 +02:00
Hubert Walczak f28e2bf9c0 session test 2023-07-09 21:09:00 +02:00
iopietro 79eb6a73d6 General fixes
+Removed almost all "BANNED" controls to template and .php UI files. The
control will be done only once and in the Session class
2018-06-11 02:22:22 +02:00
iopietro 15cae4fde9 General fixes
+Added the possibility to start a maintenance (no user will be banned)
2018-06-01 17:57:44 +02:00
iopietro f0b9f32826 General fixes
+Moved "isWinner()" method from Automation.php to Session.php, it's now
triggered when activating plus function or entering in
plus1.php/build.php
+General clean-up and better indentation
+The tournament square bonus is now displayed correctly
2018-05-22 00:33:09 +02:00
iopietro 3a14da51e0 Alliance forum fixes part 5
+Confederation and shared forums are now visible to the confederation
alliances or selected alliances/users
+Sticked topics are now displayed first
+Fixed a bug that permitted to add confederated alliances/users to
shared forums
+Minor bug fixing
2018-05-20 21:45:14 +02:00
iopietro e751a0c01f Fixed some bugs
+Returning troops time will now flow correctly in the rally point
+Resources won't be set to 0 anymore if overflow (this could have
happened in high speed servers)
+Fixed a distorted view of the right part  of the page, while reading a
mass message
2018-05-03 14:35:19 +02:00
iopietro e116511c73 Fixed a lot of bugs/security issues in the market
+Fixed a bug that permitted to send resourcers to himself
+Fixed a bug that permitted to send resources to invalid villages
+Fixed a bug that permitted to create offerings with 0 resources or
invalid resources type
+Fixed a bug that permitted to accept offerings of other allies
+Fixed a bug that permitted to accept offerings with a too high maxtime
+Fixed a bug that permitted to accept offering from the same village
+Fixed a bug that permitted to accept offering with too few merchants
+Fixed a bug that permitted to accept offerings without the requested
resources
+Fixed a bug that hid offerings with a valid maxtime
+Fixed some bugs relative to errors diplaying
+Added some error
+Some clean-up
2018-04-16 23:45:21 +02:00
Pietro 8aad98dbb7 Fixed a bug in the map
Enforcements/scouts/attacks are now tracked in the map if you've a plus account.
2018-04-04 15:41:04 +02:00
Martin Ambrus f32101b685 fix: in-game Support login fails 2017-12-01 19:51:05 +01:00
Martin Ambrus 56f605eac1 fix: logged-in users with cookies set but database cleared to log out
When switching databse data (for example restoring a backup etc.) and
a user is already logged-in (has a valid cookie, and thus PHP session)
but that user doesn't exist in the database anymore, we need to log them
out, since no data are available for them.
2017-11-25 09:32:21 +01:00
Martin Ambrus c06c62ba6a fix: hero training and revive got messed up 2017-11-22 21:38:57 +01:00
Martin Ambrus 91049ae034 refactor: no need for 2 timestamp updates
#313
2017-11-20 15:25:14 +01:00
Shadow e34b6e68f7 fix #359 2017-11-20 09:51:19 +02:00
Martin Ambrus 66132a7cdf refactor: Session.php only included once, login procedure optimization
#313
2017-11-20 00:39:37 +01:00
Martin Ambrus e3a667de10 refactor: caching more data during login
#313
2017-11-19 17:50:05 +01:00
Martin Ambrus 282d7f9db8 refactor: real hero check to use a lot less queries 2017-11-17 13:28:21 +01:00
Martin Ambrus dab768f662 refactor: 1st round of database values caching 2017-11-15 16:01:00 +01:00
Martin Ambrus ee017adb40 refactor: most of broad SELECTs updated
Closes #301
2017-11-05 14:35:19 +01:00
Martin Ambrus 6bbeb0c574 fix: session login check for admin 2017-10-28 11:25:50 +02:00
Martin Ambrus 6f7c70a0d7 refactor: autoprefixing class includes 2017-10-28 02:17:43 +02:00
Martin Ambrus 1066fff9a2 refactor: installation happens at MySQL side
A lot has happened here. Here's the list:

1. autoloader was added that should prevent various "failed to open
stream" errors when trying to load new classes

2. PHP-based data generation was replaced by MySQL-based one, hopefully
fixing the installation problems when insert payload it too high and the
DB wouldn't populate with some users

3. thanks to step 2, the installation should be really almost
instantenious, instead of waiting a long time for many SQL connections
and queries to populate the world

4. World Data & Oasis generation and population is done in 1 step now
2017-10-27 18:27:03 +02:00
Martin Ambrus 30d3b9c4fa refactor: OOP code movements started :) 2017-10-25 13:38:38 +02:00
Martin Ambrus dc0e6b6941 fix: undefined index 2017-10-25 08:08:49 +02:00
Martin Ambrus e9e55af338 fix: don't initialize messages if not logged-in 2017-10-22 13:11:19 +02:00
Martin Ambrus 7270a69a63 fix: all location headers need to have exit after them! 2017-10-22 13:00:54 +02:00
Martin Ambrus 8c61c6ec63 feat: Support can join game and see messages 2017-10-22 11:19:38 +02:00
Martin Ambrus 6f3973748c fix: more manual typecastings 2017-10-18 00:59:49 +02:00
Martin Ambrus ee467fe734 fix: sanitization of username in session where used directly in queries 2017-10-17 13:18:26 +02:00
Martin Ambrus 80c70f0f13 fix: no double-escaping of SQL queries for login 2017-10-17 12:59:03 +02:00
Martin Ambrus 1654ce498f fix: security patching due to mysql injection vulnerabilities everywhere 2017-10-17 12:21:41 +02:00
evader1337 2d26af7c46 Trying to fix this monstrosity #2 2016-09-13 18:54:25 +02:00
Domen Kajdič 2cf2f3c343 Trying to fix this monstrosity #1 2016-09-13 15:38:14 +02:00
TienTN b14568c7e0 Fix the session problem
In README note #7
2016-09-04 14:49:47 +07:00
uroskn 1afde368d3 GameEngine and install folders have 777 already set by default 2016-07-02 21:39:28 +02:00
Shadow ff5ca62a1e credits 2015-06-22 08:20:34 +03:00
sempoi 3cd3ac31a4 Update Session.php 2014-03-08 20:31:45 +08:00
Shadow 66b15135fe Update Session.php 2014-03-04 08:22:58 +02:00
Shadow c92ac12b52 Update Session.php 2013-12-21 10:16:36 +02:00
Shadow db6b3df4b9 Update Session.php 2013-12-04 08:24:40 +02:00