changed path handling for create_config_lua
thanks moteus for the hint
This commit is contained in:
@@ -856,7 +856,7 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function create_superuser() {
|
protected function create_superuser() {
|
||||||
$this->write_progress("\tChecking if superuser exists '" . $this->global_settings->domain_name . "'");
|
$this->write_progress("\tChecking if superuser exists '" . $this->admin_username . "'");
|
||||||
$sql = "select * from v_users ";
|
$sql = "select * from v_users ";
|
||||||
$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
|
$sql .= "where domain_uuid = '".$this->global_settings->domain_uuid()."' ";
|
||||||
$sql .= "and username = '".$this->admin_username."' ";
|
$sql .= "and username = '".$this->admin_username."' ";
|
||||||
@@ -877,7 +877,7 @@ include "root.php";
|
|||||||
$this->write_debug($sql);
|
$this->write_debug($sql);
|
||||||
$this->dbh->exec(check_sql($sql));
|
$this->dbh->exec(check_sql($sql));
|
||||||
}else{
|
}else{
|
||||||
$this->write_progress("\t... creating super user '" . $this->admin_username . "'");
|
$this->write_progress("\t... creating super user");
|
||||||
//add a user and then add the user to the superadmin group
|
//add a user and then add the user to the superadmin group
|
||||||
//prepare the values
|
//prepare the values
|
||||||
$this->admin_uuid = uuid();
|
$this->admin_uuid = uuid();
|
||||||
|
|||||||
@@ -278,9 +278,9 @@ include "root.php";
|
|||||||
|
|
||||||
public function create_config_lua() {
|
public function create_config_lua() {
|
||||||
$this->write_progress("\tCreating " . $this->config_lua);
|
$this->write_progress("\tCreating " . $this->config_lua);
|
||||||
$dirs = array_pop(explode("/", normalize_path($this->config_lua)));
|
$path = dirname($this->config_lua);
|
||||||
$path = normalize_path_to_os(join("/", $dirs));
|
$parent_dir = basename($path);
|
||||||
if($dirs[(sizeof($dirs)-1)] == 'resources' and !file_exists($path)){
|
if($parent_dir == 'resources' and !file_exists($path)){
|
||||||
$this->write_progress("\t... creating missing '$path'");
|
$this->write_progress("\t... creating missing '$path'");
|
||||||
if (!mkdir($path, 0755, true)) {
|
if (!mkdir($path, 0755, true)) {
|
||||||
throw new Exception("Failed to create the missing resources directory '$path'");
|
throw new Exception("Failed to create the missing resources directory '$path'");
|
||||||
@@ -412,7 +412,7 @@ include "root.php";
|
|||||||
$tmp .= " dofile(\"/etc/fusionpbx/local.lua\");\n";
|
$tmp .= " dofile(\"/etc/fusionpbx/local.lua\");\n";
|
||||||
$tmp .= " elseif (file_exists(\"/usr/local/etc/fusionpbx/local.lua\")) then\n";
|
$tmp .= " elseif (file_exists(\"/usr/local/etc/fusionpbx/local.lua\")) then\n";
|
||||||
$tmp .= " dofile(\"/usr/local/etc/fusionpbx/local.lua\");\n";
|
$tmp .= " dofile(\"/usr/local/etc/fusionpbx/local.lua\");\n";
|
||||||
$tmp .= " elseif (file_exists(script_dir..\"/resources/local.lua\")) then\n";
|
$tmp .= " elseif (file_exists(scripts_dir..\"/resources/local.lua\")) then\n";
|
||||||
$tmp .= " require(\"resources.local\");\n";
|
$tmp .= " require(\"resources.local\");\n";
|
||||||
$tmp .= " end\n";
|
$tmp .= " end\n";
|
||||||
fwrite($fout, $tmp);
|
fwrite($fout, $tmp);
|
||||||
|
|||||||
Reference in New Issue
Block a user