From 1ff1e388441aec77372639aa29efc59463d6835b Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 20 Aug 2015 09:06:45 -0600 Subject: [PATCH] Fix the path problems for the reading the acl.conf.xml. --- app/access_controls/app_defaults.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/access_controls/app_defaults.php b/app/access_controls/app_defaults.php index 58cf716a52..3abdafd8f1 100644 --- a/app/access_controls/app_defaults.php +++ b/app/access_controls/app_defaults.php @@ -35,15 +35,8 @@ $row = $prep_statement->fetch(PDO::FETCH_ASSOC); if ($row['num_rows'] == 0) { //find the file - if (file_exists('/usr/share/examples/fusionpbx/resources/templates/conf/autoload_configs')) { - $xml_file = '/usr/share/examples/fusionpbx/resources/templates/conf/autload_configs/acl.conf.xml'; - } - elseif (file_exists('/usr/local/share/fusionpbx/resources/templates/conf/autoload_configs')) { - $xml_file = '/usr/local/share/fusionpbx/resources/templates/conf/autoload_configs/acl.conf.xml'; - } - else { - $xml_file = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/conf/autoload_configs/acl.conf.xml'; - } + $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; + $xml_file = $xml_dir."/acl.conf.xml'; //load the xml and save it into an array $xml_string = file_get_contents($xml_file); @@ -112,10 +105,14 @@ //echo $sql."\n"; $db->exec(check_sql($sql)); } - } - unset($prep_statement); + } + unset($prep_statement); + + //rename the file + rename($xml_file, $xml_dir.'/acl.conf'); } } + } ?> \ No newline at end of file