diff --git a/GameEngine/Admin/Mods/config_template.php b/GameEngine/Admin/Mods/config_template.php new file mode 100644 index 00000000..a3c1e46b --- /dev/null +++ b/GameEngine/Admin/Mods/config_template.php @@ -0,0 +1,47 @@ +' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -72,7 +74,7 @@ $fh = fopen($myFile, 'w') or die("


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%'", $ERRORREPORT, $text); $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); $text = preg_replace("'%SERVERNAME%'", SERVER_NAME, $text); diff --git a/GameEngine/Admin/Mods/editExtraSet.php b/GameEngine/Admin/Mods/editExtraSet.php index 6f603dcf..dbcae21a 100755 --- a/GameEngine/Admin/Mods/editExtraSet.php +++ b/GameEngine/Admin/Mods/editExtraSet.php @@ -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.
' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -71,7 +73,7 @@ $fh = fopen($myFile, 'w') or die("


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%'", ERROR_REPORT, $text); $text = preg_replace("'%ERROR%'", ERROR_REPORT, $text); $text = preg_replace("'%SERVERNAME%'", SERVER_NAME, $text); diff --git a/GameEngine/Admin/Mods/editLogSet.php b/GameEngine/Admin/Mods/editLogSet.php index 1062252b..512799ff 100755 --- a/GameEngine/Admin/Mods/editLogSet.php +++ b/GameEngine/Admin/Mods/editLogSet.php @@ -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.
' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -67,7 +69,7 @@ $fh = fopen($myFile, 'w') or die("


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%'", $ERRORREPORT, $text); $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); $text = preg_replace("'%SERVERNAME%'", SERVER_NAME, $text); diff --git a/GameEngine/Admin/Mods/editNewFunctions.php b/GameEngine/Admin/Mods/editNewFunctions.php index cf9973d4..5a4bc359 100644 --- a/GameEngine/Admin/Mods/editNewFunctions.php +++ b/GameEngine/Admin/Mods/editNewFunctions.php @@ -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.
' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -32,7 +34,7 @@ if (!file_exists('constant_format.tpl')) { $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - $text = file_get_contents("constant_format.tpl"); + $text = admin_config_template_contents(); $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); diff --git a/GameEngine/Admin/Mods/editNewsboxSet.php b/GameEngine/Admin/Mods/editNewsboxSet.php index 5f4700db..b4265997 100755 --- a/GameEngine/Admin/Mods/editNewsboxSet.php +++ b/GameEngine/Admin/Mods/editNewsboxSet.php @@ -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.
' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -73,7 +75,7 @@ $fh = fopen($myFile, 'w') or die("


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%'", $ERRORREPORT, $text); $text = preg_replace("'%ERROR%'", $ERRORREPORT, $text); $text = preg_replace("'%SERVERNAME%'", SERVER_NAME, $text); diff --git a/GameEngine/Admin/Mods/editPlusSet.php b/GameEngine/Admin/Mods/editPlusSet.php index 1e7e5334..f25e1597 100644 --- a/GameEngine/Admin/Mods/editPlusSet.php +++ b/GameEngine/Admin/Mods/editPlusSet.php @@ -21,7 +21,9 @@ include_once("../../Database.php"); include_once("../../config.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.
' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -33,7 +35,7 @@ if (!file_exists('constant_format.tpl')) { $myFile = "../../config.php"; $fh = fopen($myFile, 'w') or die("


Can't open file: GameEngine\config.php"); - $text = file_get_contents("constant_format.tpl"); + $text = admin_config_template_contents(); $SUPPORT_MSGS_IN_ADMIN = (ADMIN_RECEIVE_SUPPORT_MESSAGES == false ? 'false' : 'true'); $ADMINS_RAIDABLE = (ADMIN_ALLOW_INCOMING_RAIDS == false ? 'false' : 'true'); diff --git a/GameEngine/Admin/Mods/editServerSet.php b/GameEngine/Admin/Mods/editServerSet.php index d5d0fc37..16c8d2c3 100755 --- a/GameEngine/Admin/Mods/editServerSet.php +++ b/GameEngine/Admin/Mods/editServerSet.php @@ -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.
' . 'Please download constant_format.tpl file and copy it into the GameEngine/Admin/Mods ' . @@ -66,7 +68,7 @@ $fh = fopen($myFile, 'w') or die("


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);