From 235678f3c79897df0e26aaa446b461efa4314541 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 23 Nov 2021 09:56:12 -0700 Subject: [PATCH] Create the voicemail directory when adding a voicemail. --- app/voicemails/voicemail_edit.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index aa6e20fa1b..9eed404a15 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -57,7 +57,7 @@ //get http variables and set them to php variables $referer_path = $_REQUEST["referer_path"]; $referer_query = $_REQUEST["referer_query"]; - if (count($_POST)>0) { + if (count($_POST) > 0) { //process the http post data by submitted action if ($_POST['action'] != '' && is_uuid($_POST['voicemail_uuid'])) { @@ -94,6 +94,7 @@ $voicemail_tutorial = $_POST["voicemail_tutorial"]; $voicemail_options_delete = $_POST["voicemail_options_delete"]; $voicemail_destinations_delete = $_POST["voicemail_destinations_delete"]; + //remove the space $voicemail_mail_to = str_replace(" ", "", $voicemail_mail_to); } @@ -222,6 +223,13 @@ $p->delete('voicemail_option_add', 'temp'); $p->delete('voicemail_destination_add', 'temp'); + //make sure the voicemail directory exists + if (is_numeric($voicemail_id)) { + if (!file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$voicemail_id)) { + mkdir($_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$voicemail_id, 0770); + } + } + //remove checked voicemail options if ( $action == 'update' @@ -797,4 +805,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?>