diff --git a/app/access_controls/app_defaults.php b/app/access_controls/app_defaults.php index e9a1253e63..dd3870e02c 100644 --- a/app/access_controls/app_defaults.php +++ b/app/access_controls/app_defaults.php @@ -36,7 +36,7 @@ //set the directory $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; $xml_file = $xml_dir."/acl.conf.xml"; - $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/acl.conf'; + $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/acl.conf'; //load the xml and save it into an array if (file_exists($xml_file)) { diff --git a/app/conference_controls/app_defaults.php b/app/conference_controls/app_defaults.php index d3d588cfc8..199c0fc736 100644 --- a/app/conference_controls/app_defaults.php +++ b/app/conference_controls/app_defaults.php @@ -35,7 +35,7 @@ //set the directory $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; $xml_file = $xml_dir."/conference.conf"; - $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/conference.conf'; + $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/conference.conf'; //rename the file if (file_exists($xml_dir.'/conference.conf.xml.noload')) { diff --git a/app/conference_profiles/app_defaults.php b/app/conference_profiles/app_defaults.php index eab37bfe66..e340044c6a 100644 --- a/app/conference_profiles/app_defaults.php +++ b/app/conference_profiles/app_defaults.php @@ -35,7 +35,7 @@ //set the directory $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; $xml_file = $xml_dir."/conference.conf"; - $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/conference.conf'; + $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/conference.conf'; //rename the file if (file_exists($xml_dir.'/conference.conf.xml.noload')) { diff --git a/app/music_on_hold/app_defaults.php b/app/music_on_hold/app_defaults.php index 79d95d666a..89a1dd4797 100644 --- a/app/music_on_hold/app_defaults.php +++ b/app/music_on_hold/app_defaults.php @@ -52,7 +52,7 @@ if ($domains_processed == 1) { if ($num_rows == 0) { //set the alternate directory - $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/resources/templates/conf/autoload_configs/local_stream.conf'; + $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/local_stream.conf'; //load the xml and save it into an array if (file_exists($xml_file)) { diff --git a/app/music_on_hold/resources/classes/switch_music_on_hold.php b/app/music_on_hold/resources/classes/switch_music_on_hold.php index 9115117be9..0a2a348488 100644 --- a/app/music_on_hold/resources/classes/switch_music_on_hold.php +++ b/app/music_on_hold/resources/classes/switch_music_on_hold.php @@ -208,7 +208,7 @@ if (!class_exists('switch_music_on_hold')) { $file_contents = file_get_contents("/usr/share/examples/fusionpbx/resources/templates/conf/autoload_configs/local_stream.conf.xml"); } else { - $file_contents = file_get_contents($_SERVER["PROJECT_ROOT"]."/resources/templates/conf/autoload_configs/local_stream.conf.xml"); + $file_contents = file_get_contents($_SERVER["PROJECT_ROOT"]."/app/switch/resources/conf/autoload_configs/local_stream.conf.xml"); } //check where the default music is stored $default_moh_prefix = 'music/default'; diff --git a/app/sip_profiles/app_defaults.php b/app/sip_profiles/app_defaults.php index 5bdcbcc9cf..4d755b8e4f 100644 --- a/app/sip_profiles/app_defaults.php +++ b/app/sip_profiles/app_defaults.php @@ -160,10 +160,15 @@ elseif (file_exists('/usr/local/share/fusionpbx/resources/templates/conf/sip_profiles')) { $sip_profile_dir = '/usr/local/share/fusionpbx/resources/templates/conf/sip_profiles/*.xml.noload'; } - else { - $sip_profile_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/conf/sip_profiles/*.xml.noload'; + elseif (file_exists('/usr/local/www/fusionpbx/app/switch/resources/conf/sip_profiles')) { + $sip_profile_dir = '/usr/local/www/fusionpbx/app/switch/resources/conf/sip_profiles/*.xml.noload'; + } + elseif (file_exists('/var/www/fusionpbx/app/switch/resources/conf/sip_profiles')) { + $sip_profile_dir = '/var/www/fusionpbx/app/switch/resources/conf/sip_profiles/*.xml.noload'; + } + else { + $sip_profile_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/switch/resources/conf/sip_profiles/*.xml.noload'; } - $xml_files = glob($sip_profile_dir); foreach ($xml_files as $x => &$xml_file) { //load the sip profile xml and save it into an array diff --git a/resources/switch.php b/resources/switch.php index 27f2c464ed..fcc534960f 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -832,7 +832,7 @@ if (!function_exists('save_call_center_xml')) { $path = "/usr/share/examples/fusionpbx/resources/templates/conf"; } else { - $path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf"; + $path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/switch/resources/conf"; } //get the contents of the template @@ -869,7 +869,7 @@ if (!function_exists('switch_conf_xml')) { $path = "/usr/share/examples/fusionpbx/resources/templates/conf"; } else { - $path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf"; + $path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/switch/resources/conf"; } $file_contents = file_get_contents($path."/autoload_configs/switch.conf.xml"); @@ -926,7 +926,7 @@ if (!function_exists('xml_cdr_conf_xml')) { $path = "/usr/share/examples/fusionpbx/resources/templates/conf"; } else { - $path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf"; + $path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/switch/resources/conf"; } $file_contents = file_get_contents($path."/autoload_configs/xml_cdr.conf.xml");