mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-09 21:01:00 +00:00
Some backup solution
Some backup solution
This commit is contained in:
@@ -32,7 +32,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
$ERRORREPORT=ERROR_REPORT;
|
||||
$T4=(T4_COMING==false)? "false":"true";
|
||||
@@ -200,9 +199,33 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Admin Info',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
@@ -32,7 +32,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
$ERRORREPORT=ERROR_REPORT;
|
||||
$T4=(T4_COMING==false)? "false":"true";
|
||||
@@ -195,9 +194,33 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Extra server settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
@@ -32,7 +32,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
$ERRORREPORT=ERROR_REPORT;
|
||||
$T4=(T4_COMING==false)? "false":"true";
|
||||
@@ -196,9 +195,33 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Log Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
@@ -32,7 +32,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
// Aceste setari trebuie trimise prin $overrides, NU prin tz_config_set
|
||||
// dupa ce functia a returnat: rezerva centrala din
|
||||
@@ -49,14 +48,13 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
|
||||
$psKeep = isset($_POST['plus_stats_keep']) ? (int) $_POST['plus_stats_keep'] : 0;
|
||||
if ($psKeep < 0 || $psKeep > 3650) { $psKeep = 0; }
|
||||
|
||||
// Minunea Lumii cu stil pe trib
|
||||
// Minunea Lumii cu stil pe trib
|
||||
$wwImgChoice = (isset($_POST['ww_image']) && $_POST['ww_image'] === 'false')
|
||||
? 'false' : 'true';
|
||||
|
||||
$text = admin_config_template_contents(array(
|
||||
'%WWIMAGE%' => $wwImgChoice,
|
||||
'%ALLIANCEBONUSES%' => $abChoice,
|
||||
'%WWIMAGE%' => $wwImgChoice,
|
||||
'%PLUSSTATS%' => $psChoice,
|
||||
'%PLUSSTATSHOURS%' => $psHours,
|
||||
'%PLUSSTATSKEEP%' => $psKeep,
|
||||
@@ -188,9 +186,33 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed New Mechanics and Functions Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
@@ -32,7 +32,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
$ERRORREPORT=ERROR_REPORT;
|
||||
$T4=(T4_COMING==false)? "false":"true";
|
||||
@@ -202,9 +201,33 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed NewsBox Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
@@ -33,7 +33,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
$text = admin_config_template_contents();
|
||||
|
||||
@@ -180,9 +179,33 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed PLUS Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
@@ -32,7 +32,6 @@ if (!admin_config_template_available()) {
|
||||
}
|
||||
|
||||
$myFile = "../../config.php";
|
||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\config.php");
|
||||
|
||||
$T4=(T4_COMING==false)? "false":"true";
|
||||
$LOG_BUILD=(LOG_BUILD==false)? "false":"true";
|
||||
@@ -292,9 +291,33 @@ $text = admin_config_template_contents(array(
|
||||
// inainte de scriere - altfel setarile modulului ar fi ignorate.
|
||||
$text = tz_config_finalize($text);
|
||||
|
||||
fwrite($fh, $text);
|
||||
// SCRIERE IN SIGURANTA.
|
||||
//
|
||||
// Inainte, fisierul se deschidea cu 'w' la INCEPUTUL scriptului, adica se
|
||||
// golea imediat. Orice eroare aparuta pana la fwrite lasa config.php GOL
|
||||
// si serverul mort. Acum scriem intai intr-un fisier temporar si abia la
|
||||
// final il punem in locul celui vechi, printr-o redenumire atomica.
|
||||
$tmpFile = $myFile . '.tmp';
|
||||
$fh = fopen($tmpFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\\config.php");
|
||||
|
||||
if (fwrite($fh, $text) === false) {
|
||||
fclose($fh);
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't write file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
fclose($fh);
|
||||
|
||||
// pastram o copie a variantei anterioare, pentru orice eventualitate
|
||||
if (is_file($myFile)) {
|
||||
@copy($myFile, $myFile . '.bak');
|
||||
}
|
||||
|
||||
if (!rename($tmpFile, $myFile)) {
|
||||
@unlink($tmpFile);
|
||||
die("<br/><br/><br/>Can't replace file: GameEngine\\config.php");
|
||||
}
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed General Server Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
Reference in New Issue
Block a user