Only make changes to files when not in development mode

This commit is contained in:
Yigit Kerem Oktay 2020-12-15 15:25:00 +03:00
parent 1408d0ad91
commit 3e706233a4
2 changed files with 14 additions and 7 deletions

View File

@ -9,6 +9,14 @@ define("COPYRIGHT_TEXT","");
require_once("classes/locale-negotiator.php"); require_once("classes/locale-negotiator.php");
require_once("classes/db-class.php"); require_once("classes/db-class.php");
$isDeveleoperEnvironement = false;
if(isset($_GET["isDev"])){
if($_GET["isDev"] == "devMode"){
$isDeveleoperEnvironement = true;
}
}
$negotiator = new LocaleNegotiator("en_GB"); $negotiator = new LocaleNegotiator("en_GB");
$message = ""; $message = "";
$db = new SSDB(); $db = new SSDB();
@ -161,11 +169,12 @@ if(isset($_POST['server']) && empty($message))
$db->setSetting($mysqli,"google_recaptcha_secret",""); $db->setSetting($mysqli,"google_recaptcha_secret","");
$db->setSetting($mysqli,"google_recaptcha_sitekey",""); $db->setSetting($mysqli,"google_recaptcha_sitekey","");
$db->setSetting($mysqli,"cron_server_ip",""); $db->setSetting($mysqli,"cron_server_ip","");
unlink("create-server-config.php"); if(!$isDeveleoperEnvironement) {
unlink("config.php.template"); unlink("create-server-config.php");
unlink("install.sql"); unlink("config.php.template");
unlink(__FILE__); unlink("install.sql");
unlink(__FILE__);
}
header("Location: ".WEB_URL); header("Location: ".WEB_URL);
} }
} }

View File

@ -1,6 +1,4 @@
<?php <?php
//This should later be translatable, maybe find a better solution?
//This is here for better generation of POT files :)
$statuses = array(_("Major outage"), _("Minor outage"), _("Planned maintenance"), _("Operational") ); $statuses = array(_("Major outage"), _("Minor outage"), _("Planned maintenance"), _("Operational") );
$classes = array("danger", "warning", "primary", "success" ); $classes = array("danger", "warning", "primary", "success" );
$icons = array("fa fa-times", "fa fa-exclamation", "fa fa-info", "fa fa-check" ); $icons = array("fa fa-times", "fa fa-exclamation", "fa fa-info", "fa fa-check" );