mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
If the extension or dialplan xml directories are disabled or don't exist don't add sub directories.
This commit is contained in:
@@ -48,23 +48,27 @@
|
||||
}
|
||||
|
||||
//if the public directory doesn't exist then create it
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { mkdir($_SESSION['switch']['dialplan']['dir'].'/public',0777,true); }
|
||||
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { mkdir($_SESSION['switch']['dialplan']['dir'].'/public',0777,true); }
|
||||
}
|
||||
|
||||
//if multiple domains then make sure that the dialplan/public/domain_name.xml file exists
|
||||
if (count($_SESSION["domains"]) > 1) {
|
||||
//make sure the public directory and xml file exist
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public'.$_SESSION['domains'][$domain_uuid]['domain_name'])) {
|
||||
mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name'],0777,true);
|
||||
}
|
||||
$file = $_SESSION['switch']['dialplan']['dir']."/public/".$_SESSION['domains'][$domain_uuid]['domain_name'].".xml";
|
||||
if (!file_exists($file)) {
|
||||
$fout = fopen($file,"w");
|
||||
$xml = "<include>\n";
|
||||
$xml .= " <X-PRE-PROCESS cmd=\"include\" data=\"".$_SESSION['domains'][$domain_uuid]['domain_name']."/*.xml\"/>\n";
|
||||
$xml .= "</include>\n";
|
||||
fwrite($fout, $xml);
|
||||
fclose($fout);
|
||||
unset($xml,$file);
|
||||
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public'.$_SESSION['domains'][$domain_uuid]['domain_name'])) {
|
||||
mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name'],0777,true);
|
||||
}
|
||||
$file = $_SESSION['switch']['dialplan']['dir']."/public/".$_SESSION['domains'][$domain_uuid]['domain_name'].".xml";
|
||||
if (!file_exists($file)) {
|
||||
$fout = fopen($file,"w");
|
||||
$xml = "<include>\n";
|
||||
$xml .= " <X-PRE-PROCESS cmd=\"include\" data=\"".$_SESSION['domains'][$domain_uuid]['domain_name']."/*.xml\"/>\n";
|
||||
$xml .= "</include>\n";
|
||||
fwrite($fout, $xml);
|
||||
fclose($fout);
|
||||
unset($xml,$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
|
||||
//if the extensions dir doesn't exist then create it
|
||||
if (!is_dir($_SESSION['switch']['extensions']['dir'])) { mkdir($_SESSION['switch']['extensions']['dir'],0777,true); }
|
||||
if (strlen($_SESSION['switch']['extensions']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['extensions']['dir'])) { mkdir($_SESSION['switch']['extensions']['dir'],0777,true); }
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
|
||||
//if the recordings directory doesn't exist then create it
|
||||
if (!is_readable($_SESSION['switch']['recordings']['dir'])) { mkdir($_SESSION['switch']['recordings']['dir'],0777,true); }
|
||||
if (strlen($_SESSION['switch']['recordings']['dir']) > 0) {
|
||||
if (!is_readable($_SESSION['switch']['recordings']['dir'])) { mkdir($_SESSION['switch']['recordings']['dir'],0777,true); }
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -27,7 +27,9 @@
|
||||
if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
|
||||
//if the resource scripts resource directory does not exist then create it
|
||||
if (!is_dir($_SESSION['switch']['scripts']['dir']."/resources")) { mkdir($_SESSION['switch']['scripts']['dir']."/resources",0755,true); }
|
||||
if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
|
||||
if (!is_dir($_SESSION['switch']['scripts']['dir']."/resources")) { mkdir($_SESSION['switch']['scripts']['dir']."/resources",0755,true); }
|
||||
}
|
||||
|
||||
//get odbc information
|
||||
$sql = "select count(*) as num_rows from v_databases ";
|
||||
|
||||
Reference in New Issue
Block a user