From 2c97d2952c37db50e0f49d6cf57a01e81b0aa7f0 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Sun, 22 Mar 2015 08:22:51 +0000 Subject: [PATCH] Fax Server: Additional checks on folder presence and permissions. --- app/fax/fax_send.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 855ab8ce59..cd8a128340 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -108,7 +108,15 @@ if (!$included) { //make sure the directories exist if (!is_dir($_SESSION['switch']['storage']['dir'])) { mkdir($_SESSION['switch']['storage']['dir']); - chmod($dir_fax_sent,0774); + chmod($_SESSION['switch']['storage']['dir'],0774); + } + if (!is_dir($_SESSION['switch']['storage']['dir'].'/fax')) { + mkdir($_SESSION['switch']['storage']['dir'].'/fax'); + chmod($_SESSION['switch']['storage']['dir'].'/fax',0774); + } + if (count($_SESSION["domains"]) > 1 && !is_dir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'])) { + mkdir($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']); + chmod($_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'],0774); } if (!is_dir($fax_dir.'/'.$fax_extension)) { mkdir($fax_dir.'/'.$fax_extension,0774,true);