From c543c42ffaa4325d34235d0646b8ea1a29d23873 Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Fri, 4 Dec 2015 12:57:30 +0300 Subject: [PATCH] Change. Use path with domain name for faxes for single tenant installation. --- app/fax/fax_edit.php | 7 +------ app/fax/fax_files.php | 2 +- app/fax/fax_files_remote.php | 2 +- app/fax/fax_send.php | 2 +- app/fax/resources/classes/fax.php | 7 +------ 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index e690d06739..77a473567a 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -53,12 +53,7 @@ else { } //set the fax directory - if (count($_SESSION["domains"]) > 1) { - $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']; - } - else { - $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax'; - } + $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']; //get the fax extension if (strlen($fax_extension) > 0) { diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index 8f83b675dd..bb08fa837d 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -86,7 +86,7 @@ else { } //set the fax directory - $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax'.((count($_SESSION["domains"]) > 1) ? '/'.$_SESSION['domain_name'] : null); + $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']; //download the fax if ($_GET['a'] == "download") { diff --git a/app/fax/fax_files_remote.php b/app/fax/fax_files_remote.php index ddc87a7dca..28c5d76b83 100644 --- a/app/fax/fax_files_remote.php +++ b/app/fax/fax_files_remote.php @@ -135,7 +135,7 @@ else { if (imap_delete($connection, $email_id, FT_UID)) { if (imap_expunge($connection)) { //clean up local inbox copy - $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax'.((count($_SESSION["domains"]) > 1) ? '/'.$_SESSION['domain_name'] : null); + $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']; @unlink($fax_dir.'/'.$fax_extension.'/inbox/'.$attachment[0]['filename']); //redirect user $_SESSION["message"] = $text['message-delete']; diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index b5491287a0..aabf063277 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -101,7 +101,7 @@ if (!$included) { } //set the fax directory - $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax'.((count($_SESSION["domains"]) > 1) ? '/'.$_SESSION['domain_name'] : null); + $fax_dir = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name']; // set fax cover font to generate pdf $fax_cover_font = $_SESSION['fax']['cover_font']['text']; diff --git a/app/fax/resources/classes/fax.php b/app/fax/resources/classes/fax.php index b86627c44c..0100aeaeaa 100644 --- a/app/fax/resources/classes/fax.php +++ b/app/fax/resources/classes/fax.php @@ -174,12 +174,7 @@ $dialplan["dialplan_details"][$y]["domain_uuid"] = $this->domain_uuid; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; $dialplan["dialplan_details"][$y]["dialplan_detail_type"] = "rxfax"; - if (count($_SESSION["domains"]) > 1) { - $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'].'/'.$this->fax_extension.'/inbox/'.$this->forward_prefix.'${last_fax}.tif'; - } - else { - $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $_SESSION['switch']['storage']['dir'].'/fax/'.$this->fax_extension.'/inbox/'.$this->forward_prefix.'${last_fax}.tif'; - } + $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = $_SESSION['switch']['storage']['dir'].'/fax/'.$_SESSION['domain_name'].'/'.$this->fax_extension.'/inbox/'.$this->forward_prefix.'${last_fax}.tif'; $dialplan["dialplan_details"][$y]["dialplan_detail_group"] = "1"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $y * 10; $y++;