Update install_fusionpbx.php

Move to core default settings app defaults.
This commit is contained in:
FusionPBX
2016-11-27 17:05:37 -07:00
committed by GitHub
parent 2e1e575056
commit 373eb5ffc5

View File

@@ -609,6 +609,7 @@ include "root.php";
throw new Exception("Domain already exists but is disabled, this is unexpected");
}
} else {
//add the domain
$this->write_progress("\t... creating domain");
$sql = "insert into v_domains ";
$sql .= "(";
@@ -629,81 +630,7 @@ include "root.php";
}
unset($sql);
//domain settings
$x = 0;
$tmp[$x]['name'] = 'uuid';
$tmp[$x]['value'] = $this->menu_uuid;
$tmp[$x]['category'] = 'domain';
$tmp[$x]['subcategory'] = 'menu';
$tmp[$x]['enabled'] = 'true';
$x++;
$tmp[$x]['name'] = 'name';
$tmp[$x]['category'] = 'domain';
$tmp[$x]['subcategory'] = 'time_zone';
$tmp[$x]['enabled'] = 'true';
$x++;
$tmp[$x]['name'] = 'code';
$tmp[$x]['value'] = 'en-us';
$tmp[$x]['category'] = 'domain';
$tmp[$x]['subcategory'] = 'language';
$tmp[$x]['enabled'] = 'true';
$x++;
$tmp[$x]['name'] = 'iso_code';
$tmp[$x]['value'] = $this->default_country;
$tmp[$x]['category'] = 'domain';
$tmp[$x]['subcategory'] = 'country';
$tmp[$x]['enabled'] = 'true';
$x++;
$tmp[$x]['name'] = 'name';
$tmp[$x]['value'] = $this->template_name;
$tmp[$x]['category'] = 'domain';
$tmp[$x]['subcategory'] = 'template';
$tmp[$x]['enabled'] = 'true';
$x++;
//server settings
$tmp[$x]['name'] = 'dir';
$tmp[$x]['value'] = $this->global_settings->switch_temp_dir();
$tmp[$x]['category'] = 'server';
$tmp[$x]['subcategory'] = 'temp';
$tmp[$x]['enabled'] = 'true';
$x++;
$x++;
$tmp[$x]['name'] = 'dir';
$tmp[$x]['value'] = $this->global_settings->switch_backup_vdir();
$tmp[$x]['category'] = 'server';
$tmp[$x]['subcategory'] = 'backup';
$tmp[$x]['enabled'] = 'true';
$x++;
$this->dbh->beginTransaction();
foreach($tmp as $row) {
$sql = "insert into v_default_settings ";
$sql .= "(";
$sql .= "default_setting_uuid, ";
$sql .= "default_setting_name, ";
$sql .= "default_setting_value, ";
$sql .= "default_setting_category, ";
$sql .= "default_setting_subcategory, ";
$sql .= "default_setting_enabled ";
$sql .= ") ";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'".$row['name']."', ";
$sql .= "'".$row['value']."', ";
$sql .= "'".$row['category']."', ";
$sql .= "'".$row['subcategory']."', ";
$sql .= "'".$row['enabled']."' ";
$sql .= ");";
$this->write_debug($sql);
$this->dbh->exec(check_sql($sql));
unset($sql);
}
$this->dbh->commit();
unset($tmp);
//get the list of installed apps from the core and mod directories
//get the list of installed apps from the core and mod directories
$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_config.php");
$x=0;
foreach ($config_list as $config_path) {
@@ -952,4 +879,4 @@ include "root.php";
}
}
?>
?>