Use PHP mkdir function.

This commit is contained in:
FusionPBX 2021-12-02 18:14:46 -07:00 committed by GitHub
parent 5e760a363f
commit a5e249db02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -52,7 +52,9 @@
//if the public directory doesn't exist then create it
if ($domains_processed == 1) {
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { event_socket_mkdir($_SESSION['switch']['dialplan']['dir'].'/public'); }
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) {
mkdir($_SESSION['switch']['dialplan']['dir'].'/public', 0770, false);
}
}
}
@ -61,7 +63,7 @@
//make sure the public directory and xml file exist
if (strlen($_SESSION['switch']['dialplan']['dir']) > 0) {
if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public'.$_SESSION['domains'][$domain_uuid]['domain_name'])) {
event_socket_mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name']);
mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name'], 0770, false);
}
$file = $_SESSION['switch']['dialplan']['dir']."/public/".$_SESSION['domains'][$domain_uuid]['domain_name'].".xml";
if (!file_exists($file)) {