diff --git a/app/vars/app_defaults.php b/app/vars/app_defaults.php index 1e2e7fd27b..83681e63b6 100644 --- a/app/vars/app_defaults.php +++ b/app/vars/app_defaults.php @@ -58,8 +58,14 @@ if ($domains_processed == 1) { elseif (file_exists('/usr/local/share/fusionpbx/resources/templates/conf/vars.xml')) { $xml_file = '/usr/local/share/fusionpbx/resources/templates/conf/vars.xml'; } + elseif (file_exists('/usr/local/www/fusionpbx/app/switch/resources/conf/vars.xml')) { + $xml_file = '/usr/local/www/fusionpbx/app/switch/resources/conf/vars.xml'; + } + elseif (file_exists('/var/www/fusionpbx/app/switch/resources/conf/vars.xml')) { + $xml_file = '/var/www/fusionpbx/app/switch/resources/conf/vars.xml'; + } else { - $xml_file = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/conf/vars.xml'; + $xml_file = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'app/switch/resources/conf/vars.xml'; } //load the xml and save it into an array @@ -96,11 +102,13 @@ if ($domains_processed == 1) { $p->add("var_edit", "temp"); //execute insert - $database = new database; - $database->app_name = 'vars'; - $database->app_uuid = '54e08402-c1b8-0a9d-a30a-f569fc174dd8'; - $database->save($array, false); - $message = $database->message; + if (!empty($array)) { + $database = new database; + $database->app_name = 'vars'; + $database->app_uuid = '54e08402-c1b8-0a9d-a30a-f569fc174dd8'; + $database->save($array, false); + $message = $database->message; + } //revoke temporary permissions $p->delete("var_add", "temp"); @@ -219,4 +227,4 @@ if ($domains_processed == 1) { } -?> \ No newline at end of file +?>