fix(admin): read config template from the version-controlled copy [#322] (#324)

This commit is contained in:
Ferywir
2026-07-01 15:15:08 +02:00
committed by GitHub
parent eee3d6f355
commit d791958702
8 changed files with 75 additions and 14 deletions
+4 -2
View File
@@ -20,7 +20,9 @@ csrf_verify();
include_once("../../Database.php");
$id = (int) $_POST['id'];
if (!file_exists('constant_format.tpl')) {
require_once(__DIR__ . '/config_template.php');
if (!admin_config_template_available()) {
die(
'You seem to be running a new version of TravianZ which was installed using an old installer.<br />' .
'Please download <strong>constant_format.tpl</strong> file and copy it into the <strong>GameEngine/Admin/Mods</strong> ' .
@@ -66,7 +68,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
$NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM = (NEW_FUNCTIONS_SPECIAL_MEDALS_SYSTEM == false ? 'false' : 'true');
$NEW_FUNCTIONS_MILESTONES = (NEW_FUNCTIONS_MILESTONES == false ? 'false' : 'true');
$text = file_get_contents("constant_format.tpl");
$text = admin_config_template_contents();
$text = preg_replace("'%ERRORREPORT%'", $_POST['error'], $text);
$text = preg_replace("'%ERROR%'", $_POST['error'], $text);
$text = preg_replace("'%SERVERNAME%'", $_POST['servername'], $text);