Commit Graph

211 Commits

Author SHA1 Message Date
Ferywir b7e943ea90 fix(admin): wire CSRF token into admin.php-routed forms [#139] (#244) 2026-06-20 06:44:12 +03:00
Ferywir 1a797bab80 fix(admin): prevent SQL injection in editAccess Mod [#139] (#241) 2026-06-19 13:30:25 +03:00
Ferywir 9c726a05b9 fix(admin): re-check admin rank in addUsers Mod (defense-in-depth) [#139] (#240) 2026-06-18 19:09:02 +03:00
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 20804d9182 feat: IP ban support (#185) (#188) 2026-06-09 15:15:27 +03:00
Catalin Novgorodschi fabe77e3b8 Update delAli.php fiz 2026-06-09 11:06:32 +03:00
Catalin Novgorodschi 695a4352e8 Fix delAli.php blank page
Fix del ali blank page
2026-06-09 08:07:23 +03:00
Catalin Novgorodschi 00de16b2ec Code backend for delete user
Code backend for delete user
2026-06-09 08:05:40 +03:00
novgorodschi catalin 524a352946 Fix forgot for editBuildings name
Fix forgot for editBuildings name
2026-06-05 13:10:59 +03:00
novgorodschi catalin efbb2bc89a Fix lang server set
Fix lang server set
2026-06-04 13:19:10 +03:00
Catalin Novgorodschi 28ddc72c01 Merge pull request #175 from Ferywir/feat/per-user-language
Add per-user language selection (closes #166)
2026-06-04 13:15:24 +03:00
novgorodschi catalin 1a4014218c Fix something broken
Fix something broken
2026-06-04 12:35:53 +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
TravianZ Patcher 903c4a3285 Add missing handler for admin "Create System Message"
The admin panel had a "Create System Message" page (admin.php?p=sysmessage
-> Admin/Templates/sysmessage.tpl) whose form posts to
GameEngine/Admin/Mods/sysmessage.php, but that backend file never existed,
so submitting returned a 404 (Not Found).

Add the handler implementing the prepare -> confirm -> execute flow used by
the template. On execute it displays a global system message to all players
using the existing mechanism (writes Templates/text.tpl from
text_format.tpl and sets users.ok = 1), same as the legacy sysmsg.php.
%TEKST% is escaped for the PHP double-quoted string context to avoid
breakage/injection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 07:34:57 +02:00
novgorodschi catalin b495dcb559 Some fix
Some fix
2026-06-02 12:58:20 +03:00
novgorodschi catalin 547e164143 Edit some access for MH user and recreate mass messaage
Edit some access for MH user and recreate mass message and new maintenance system view for admins
2026-06-02 10:59:35 +03:00
novgorodschi catalin 2eaa92fc03 Fix gold log script
Fix gold log script
2026-06-02 08:10:46 +03:00
novgorodschi catalin dbe20c49b5 Some last fix for logs! 2026-05-28 13:22:27 +03:00
novgorodschi catalin 1b119d2a35 Fix special medals
Fix special medals
2026-05-26 14:42:19 +03:00
novgorodschi catalin 24fb80371d Fix special medal system
Fix special medal system
2026-05-26 12:34:50 +03:00
novgorodschi catalin 8c3ab3e5eb Fix some bugs + added (coded delAli)
Fix some bugs + added (coded delAli)
2026-05-25 12:37:33 +03:00
novgorodschi catalin a4e2c506a8 Redesign Admin Panel
Full frontend & backend redesign and refactor
2026-05-25 10:23:39 +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
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
novgorodschi catalin 878ecec687 Added Account transactions with History
Added Account transactions with History
2026-05-21 11:23:45 +03:00
Catalin Novgorodschi 1dde2599f3 fix addUsers.tpl 2025-10-23 09:59:39 +03:00
Catalin Novgorodschi 4a387bac0c @lietuvis10 fix for addUser
@lietuvis10 fix for addUser
2025-10-23 09:54:41 +03:00
Catalin Novgorodschi 59c1114b1c Change some text on license TravianZ 2025-02-11 11:22:22 +02:00
221V 18571d70b1 fix sql export-import - use html entities 2025-02-06 21:00:09 +02:00
nixpc e39ca488a9 Fix CVE-2023-36995 2023-07-06 23:02:00 +02:00
Shadow 4c68d8dd39 Update to version 8.3.5
Many Fixes
2022-02-18 13:56:17 +02:00
Vladyslav d59aa8e072 Minor changes and additions
+Added a medal of 10 years of playing in Travian.
Enabled (Disabled) during installation and in the
admin panel.
+If at least one of the new functions is enabled,
a corresponding section appears in the Manual
with a description of all the new functions and
shows which of them is Enabled or Disabled.
+Minor changes
2018-09-03 22:05:54 +03:00
Vladyslav b9ceb86392 Some improvements and changes
+Added the ability to change the position of Direct links
+Added the ability to Enable (Disable) veteran medals
2018-08-31 17:15:53 +03:00
Vladyslav c9d18675ce Minor changes
+Added Enable (Disable) of information about the troops of Nature and Natars in the manual

NOTE 1: To play this version of the game, you need to reinstall the server OR you can simply add these lines of code into your file:

GameEngine/config.php

define("NEW_FUNCTIONS_MANUAL_NATURENATARS", false);

GameEngine/Admin/Mods/constant_format.tpl

define("NEW_FUNCTIONS_MANUAL_NATURENATARS", %NEW_FUNCTIONS_MANUAL_NATURENATARS%);

NOTE 2: pay special attention to the fact that these are two different records !!! If the records are entered incorrectly, you will receive a non-working code!
2018-08-28 17:08:46 +03:00
Vladyslav 22548258f0 Minor changes and additions
+Added the ability to Enable (Disable) the display of the targets of the catapults in the rally point
+Added the display of the village with a wonder of the world (as is done with the display of artifacts) in the viewing player profiles. Also this function is Enabled (Disable) during installation and in the admin panel.
2018-08-27 18:15:53 +03:00
Shadow a263f17ecc Merge branch 'master' of https://github.com/Shadowss/TravianZ 2018-08-02 13:31:21 +03:00
Shadow cec37642c4 @velhbxtyrj updates 2018-08-02 13:31:18 +03:00
iopietro f032523e1c Generale fixes
+Fixed a bug that didn't return reinforcements in counquered oasis, if
it was released by the owner, or from the admin panel
+Changed the catapults and rams formulas (still not completed at 100%),
thanks to Kirilloid!
+Changed the Natars' capital default coordinates
2018-07-28 15:07:52 +02:00
iopietro d3a78a5ea5 Admin panel fixes
+Plus and bonuses duration, can now be decreased or resetted, by
inserting a negative value of days
+Artifacts and artifacts villages created on a user account, won't
contain any troops
+Some clean up
2018-07-27 02:25:08 +02:00
iopietro b9a442b423 General fixes
+Fixed a bug that would have killed all troops by starvation, if added
through the admin panel
2018-07-25 17:17:52 +02:00
iopietro 1f86162179 Artifacts fix
+Added the possibility to add WW villages to a player, in the admin
panel
+Fixed the WW villages counter
+Deleted Natars' artifacts can now be recovered from the admin panel
2018-07-25 15:32:14 +02:00
iopietro ee0b4984c2 #554 Fixes and General fixes
+Fixed a bug that could have happened in the statistics if there were 0
users in the server
+Fixed a compatibility bug with PHP 7.0
2018-07-24 18:19:44 +02:00
iopietro 77136a9784 Artifacts update and optimizations
+Added the "Artifacts" section in the Admin Panel, which contains two
options: return a deleted artifact to the Natars and create new
Artifacts, assigned to a specified player
+Return to Natars coded, in the village section of the Admin Panel
+Moved a lot of functions and costants from Automation.php to the "new"
class Artifacts.php
+Optimized a lot the whole Natars creation process, decreased the number
of query of about 600
+Optimized a lot the function which deletes a player's account, it's now
executed almost instantly, even with players with a lot of villages
+Redesigned the map spawn system, using a more Travian-like village
distribution
+Fixed a bug that did show a broken village in the artifact chronology,
if that village was destroyed
+Reduced the amount of redundant code (about 230 lines) for
27_1.tpl/27_2.tpl and 27_3.tpl
+Fixed a bug that permitted to build the Great Granary and the Great
Warehouse in the whole account, with only a village effect artifact
+Fixed a bug in the Admin Panel map that didn't permit to show village
informations, if that village contained single quotes in its name
2018-07-24 03:04:25 +02:00
Vladyslav 3f64e4f3bc Enable (Disable) Vacation Mode
+Enable (Disable) Vacation Mode
+Fixed an error displaying the icon to
delete the villages in the admin search

NOTE 1: To play this version of the game, you need
to reinstall the server OR you can simply add
these lines of code into your file:

GameEngine/config.php

define("NEW_FUNCTIONS_VACATION", false);

GameEngine/Admin/Mods/constant_format.tpl

define("NEW_FUNCTIONS_VACATION", %NEW_FUNCTIONS_VACATION%);

NOTE 2: pay special attention to the fact that these are two
different records !!! If the records are entered incorrectly,
you will receive a non-working code!
2018-06-26 20:52:47 +03:00
Vladyslav dffdcc4411 Enable (Disable) some new features
+Enable (Disable) New forum post message
+Enable (Disable) Tribes images in profile
+Enable (Disable) MHs images in profile
+Enable (Disable) Display artifact in profile
+Minor changes

NOTE 1: To play this version of the game, you need to reinstall
the server OR you can simply add these lines of code into your file:
ameEngine/config.php

define("NEW_FUNCTIONS_FORUM_POST_MESSAGE", False);
define("NEW_FUNCTIONS_TRIBE_IMAGES", False);
define("NEW_FUNCTIONS_MHS_IMAGES", False);
define("NEW_FUNCTIONS_DISPLAY_ARTIFACT", False);

GameEngine/Admin/Mods/constant_format.tpl

define("NEW_FUNCTIONS_FORUM_POST_MESSAGE", %NEW_FUNCTIONS_FORUM_POST_MESSAGE%);
define("NEW_FUNCTIONS_TRIBE_IMAGES", %NEW_FUNCTIONS_TRIBE_IMAGES%);
define("NEW_FUNCTIONS_MHS_IMAGES", %NEW_FUNCTIONS_MHS_IMAGES%);
define("NEW_FUNCTIONS_DISPLAY_ARTIFACT", %NEW_FUNCTIONS_DISPLAY_ARTIFACT%);

NOTE 2: pay special attention to the fact that these are two
different records !!! If the records are entered incorrectly,
you will receive a non-working code!
2018-06-25 21:06:30 +03:00
iopietro 10de3dd1b3 General fixes
+Fixed a little mistake

NOTE: In order to play this version of the game properly, you need to refresh your browser cache
2018-06-21 15:50:49 +02:00
iopietro fc562d92dd Merge branch 'master' of https://github.com/Shadowss/TravianZ
Conflicts:
	Templates/Profile/overview.tpl
2018-06-21 15:01:56 +02:00
iopietro c574a71b3a General fixes
+Fixed a bug that didn't delete artifacts when a player deleted his
account
+Added "(artifact)" if a village has an artifact in the village overview
+Added the artifact section in the multihunter panel (return to natars
doesn't work yet)

NOTE: To play this version of the game, you have to run this query first
(where "s1_" is the prefix of your server):

ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER
`lastupdate`;
ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX
`active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`);
2018-06-21 14:43:47 +02:00
Vladyslav c1eb10b19b Enable (Disable) Alliance invitation message
+Now during the installation (or after installation in the admin panel) you can Enable (Disable) sending an in-game message to the player, if he was invited to the alliance.
+Preparing the code for Enable (Disable) "New Alliance & Embassy Mechanics"

NOTE 1: To play this version of the game, you need to reinstall the server OR you can simply add these lines of code into your file:
GameEngine/config.php

define("NEW_FUNCTIONS_ALLIANCE_INVITATION", True);
define("NEW_FUNCTIONS_EMBASSY_MECHANICS", False);

GameEngine/Admin/Mods/constant_format.tpl

define("NEW_FUNCTIONS_ALLIANCE_INVITATION", %NEW_FUNCTIONS_ALLIANCE_INVITATION%);
define("NEW_FUNCTIONS_EMBASSY_MECHANICS", %NEW_FUNCTIONS_EMBASSY_MECHANICS%);

NOTE 2: pay special attention to the fact that these are two different records !!! If the records are entered incorrectly, you will receive a non-working code!

NOTE 3: it is also necessary to follow the instructions with this change (if they were not previously executed) https://github.com/Shadowss/TravianZ/commit/11ae61c013d663304086ecfd5d845040ebf2f144
2018-06-20 19:34:05 +03:00
Vladyslav 11ae61c013 Enable and disable display of oases
+Now during the installation (or after installation in the admin panel) you can enable or disable oasis display for villages in the player profile.

NOTE: To play this version of the game, you need to reinstall the server OR you can simply add these lines of code into your file:
GameEngine/config.php

/////////////////////////////////////////////////
//   ****  NEW MECHANICS AND FUNCTIONS  ****   //
/////////////////////////////////////////////////
define("NEW_FUNCTIONS_OASIS", True);

GameEngine/Admin/Modsconstant_format.tpl

/////////////////////////////////////////////////
//   ****  NEW MECHANICS AND FUNCTIONS  ****   //
/////////////////////////////////////////////////
define("NEW_FUNCTIONS_OASIS", %NEW_FUNCTIONS_OASIS%);

NOTICE 2: pay special attention to the fact that these are two different records !!! If the records are entered incorrectly, you will receive a non-working code!
2018-06-20 16:57:13 +03:00