Check old-styled-config and check write-permissions

This commit is contained in:
dg9vh 2016-05-25 15:08:36 +00:00
parent 09e8c929d1
commit cfa48e23b6
2 changed files with 16 additions and 4 deletions

View file

@ -55,10 +55,17 @@ function createConfigLines() {
}
function checkSetup() {
if (file_exists ("setup.php")) {
if (null == DISTRIBUTION) {
?>
<div class="alert alert-danger" role="alert">You forgot to remove setup.php in root-directory of your dashboard! Please delete the file!</div>
<div class="alert alert-danger" role="alert">You are using an old config.php. Please configure your Dashboard by calling <a href="setup.php">setup.php</a>!</div>
<?php
} else {
if (file_exists ("setup.php")) {
?>
<div class="alert alert-danger" role="alert">You forgot to remove setup.php in root-directory of your dashboard or you forgot to configure it! Please delete the file or configure your Dashboard by calling <a href="setup.php">setup.php</a>!</div>
<?php
}
}
}
?>

View file

@ -20,7 +20,12 @@ include "include/tools.php";
<?php
if ($_GET['cmd'] =="writeconfig") {
if (!file_exists('./config')) {
mkdir('./config', 0777, true);
if (!mkdir('./config', 0777, true)) {
?>
<div class="alert alert-danger" role="alert">You forgot to give write-permissions to your webserver-user, see point 3 in <a href="linux-step-by-step.md">linux-step-by-step.md</a>!</div>
<?php
}
}
$configfile = fopen("config/config.php", 'w');
fwrite($configfile,"<?php\n");