Another try to make sure config.php is written before going further
This commit is contained in:
@@ -803,11 +803,7 @@ if (isset($_POST['add_database'])) {
|
|||||||
$new_config .= "\$repo_branch = 'master';\n";
|
$new_config .= "\$repo_branch = 'master';\n";
|
||||||
$new_config .= "\$installation_id = '$installation_id';\n";
|
$new_config .= "\$installation_id = '$installation_id';\n";
|
||||||
|
|
||||||
if (file_put_contents("config.php", $new_config) === false) {
|
if (file_put_contents("config.php", $new_config) !== false && file_exists('config.php')) {
|
||||||
$_SESSION['alert_message'] = "Failed to write the config.php file to the filesystem. Please input the database information again.";
|
|
||||||
header("Location: setup.php?database");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
include("config.php");
|
include("config.php");
|
||||||
|
|
||||||
@@ -838,6 +834,13 @@ if (isset($_POST['add_database'])) {
|
|||||||
header("Location: setup.php?user");
|
header("Location: setup.php?user");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// There was an error writing the file
|
||||||
|
// Display an error message and redirect to the setup page
|
||||||
|
$_SESSION['alert_message'] = "Did not successfully write the config.php file to the filesystem, Please Input the database information again.";
|
||||||
|
header("Location: setup.php?database");
|
||||||
|
exit;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['add_user'])) {
|
if (isset($_POST['add_user'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user