mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
Update install.php to prevent creating an empty config.php file
I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.
This commit is contained in:
parent
31baee5e41
commit
6e27d888c3
@ -23,7 +23,6 @@ Contributors to LibreNMS:
|
||||
- Stuart Henderson <stu@spacehopper.org> (sthen)
|
||||
- Filippo Giunchedi <filippo@esaurito.net> (filippog)
|
||||
- Lasse Leegaard <lasse@brandbil.dk> (lasseleegaard)
|
||||
- Mohammad Al-Shami <mohammad@al-shami.net> (mohshami)
|
||||
|
||||
[1]: http://observium.org/ "Observium web site"
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ include("../includes/defaults.inc.php");
|
||||
// Work out the install directory
|
||||
$cur_dir = explode('/',$_SERVER['DOCUMENT_ROOT']);
|
||||
$install_dir = array_pop($cur_dir);
|
||||
$install_dir = array_pop($cur_dir);
|
||||
#$install_dir = array_pop($cur_dir);
|
||||
$install_dir = implode('/',$cur_dir);
|
||||
$config['install_dir'] = $install_dir;
|
||||
$config['log_dir'] = $install_dir.'/logs';
|
||||
@ -409,9 +409,9 @@ EOD;
|
||||
if(!file_exists("../config.php"))
|
||||
{
|
||||
$conf = fopen("../config.php", 'w');
|
||||
if ($conf === false)
|
||||
if ($conf != false)
|
||||
{
|
||||
if(fwrite($handle, '<?php') === FALSE)
|
||||
if(fwrite($conf, "<?php\n") === FALSE)
|
||||
{
|
||||
echo("<div class='alert alert-danger'>We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)</div>");
|
||||
echo("<pre><?php\n".stripslashes($config_file)."</pre>");
|
||||
@ -419,7 +419,7 @@ EOD;
|
||||
else
|
||||
{
|
||||
$config_file = stripslashes($config_file);
|
||||
fwrite($handle,$config_file);
|
||||
fwrite($conf,$config_file);
|
||||
echo("<div class='alert alert-success'>The config file has been created</div>");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user