fix redirect loop if no config.php exists

This commit is contained in:
johnny@pittpc.com
2019-08-24 21:26:26 -04:00
parent 59db66f17e
commit 970568b182
2 changed files with 13 additions and 7 deletions

View File

@@ -3,7 +3,11 @@
include("config.php");
include("functions.php");
if(!isset($config_enable_setup) or $config_enable_setup == 0){
if(!isset($config_enable_setup)){
$config_enable_setup = 1;
}
if($config_enable_setup == 0){
header("Location: login.php");
}
@@ -85,12 +89,14 @@ if(isset($_POST['add_database'])){
fwrite($myfile, $txt);
$txt = "\$config_app_name = 'IT CRM';\n\n";
$txt = "\$config_app_name = 'IT CRM';\n";
fwrite($myfile, $txt);
fclose($myfile);
include("config.php");
// Name of the file
$filename = 'db.sql';
// Temporary variable, used to store current query
@@ -196,7 +202,7 @@ if(isset($_POST['add_company_settings'])){
fwrite($myfile, $txt);
$txt = "?>";
$txt = "?>\n";
fwrite($myfile, $txt);