mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Use is_writable on the config directory
- If the directory is writable and config.php exists then use it to write the config.conf file. - Otherwise provide a message on the commands to run to create the config.conf file.
This commit is contained in:
@@ -90,15 +90,15 @@
|
||||
if (!$config_exists) {
|
||||
if (file_exists("/usr/local/etc/fusionpbx/config.php")) {
|
||||
//bsd
|
||||
$config_php = "/usr/local/etc/fusionpbx/config.php";
|
||||
$config_path = "/usr/local/etc/fusionpbx";
|
||||
}
|
||||
elseif (file_exists("/etc/fusionpbx/config.php")) {
|
||||
//linux
|
||||
$config_php = "/etc/fusionpbx/config.php";
|
||||
$config_path = "/etc/fusionpbx";
|
||||
}
|
||||
if (isset($config_php)) {
|
||||
if (isset($config_path) && is_writable($config_path)) {
|
||||
//include the config.php file
|
||||
include $config_php;
|
||||
include $config_path.'/config.php';
|
||||
|
||||
//build the config file
|
||||
$install = new install;
|
||||
@@ -113,6 +113,14 @@
|
||||
header("Location: /");
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
//config directory is not writable run commands as root
|
||||
echo "Please run the following commands as root.<br />\n";
|
||||
echo "cd ".$document_root."<br />\n";
|
||||
echo "php ".$document_root."/core/upgrade/upgrade.php<br />\n";
|
||||
unset($config_path);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//process and save the data
|
||||
|
||||
Reference in New Issue
Block a user