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..12104e4e81 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -58,13 +58,17 @@ if (!$included) { $fax_uuid = check_str($_REQUEST["id"]); if (if_group("superadmin") || if_group("admin")) { //show all fax extensions - $sql = "select * from v_fax "; + $sql = "select fax_uuid, fax_extension, fax_caller_id_name, fax_caller_id_number, "; + $sql .= "accountcode, fax_send_greeting "; + $sql .= "from v_fax "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and fax_uuid = '$fax_uuid' "; } else { //show only assigned fax extensions - $sql = "select * from v_fax as f, v_fax_users as u "; + $sql = "select f.fax_uuid, f.fax_extension, f.fax_caller_id_name, f.fax_caller_id_number, "; + $sql .= "f.accountcode, f.fax_send_greeting "; + $sql .= "from v_fax as f, v_fax_users as u "; $sql .= "where f.fax_uuid = u.fax_uuid "; $sql .= "and f.domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and f.fax_uuid = '$fax_uuid' "; @@ -101,7 +105,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++; diff --git a/core/install/install_first_time.php b/core/install/install_first_time.php index dcc7e04ade..1b629de24b 100644 --- a/core/install/install_first_time.php +++ b/core/install/install_first_time.php @@ -309,6 +309,8 @@ if(!$install_step) { $install_step = 'select_language'; } $switch = new install_switch($global_settings); //$switch->debug = true; //$system->debug = true; + $switch->echo_progress = true; + $system->echo_progress = true; $system->install_phase_1(); $switch->install_phase_1(); $system->install_phase_2(); diff --git a/core/install/resources/classes/install_fusionpbx.php b/core/install/resources/classes/install_fusionpbx.php index 28bed4cd17..41d28ca92c 100644 --- a/core/install/resources/classes/install_fusionpbx.php +++ b/core/install/resources/classes/install_fusionpbx.php @@ -35,6 +35,7 @@ include "root.php"; protected $dbh; public $debug = false; + public $echo_progress = false; public $install_language = 'en-us'; public $admin_username; @@ -71,7 +72,9 @@ include "root.php"; } function write_progress($message) { - echo "$message\n"; + if($this->echo_progress){ + echo "$message\n"; + } } function install_phase_1() { diff --git a/core/install/resources/classes/install_switch.php b/core/install/resources/classes/install_switch.php index bdf9a2c48b..3fb3950cb6 100644 --- a/core/install/resources/classes/install_switch.php +++ b/core/install/resources/classes/install_switch.php @@ -33,6 +33,7 @@ include "root.php"; protected $dbh; public $debug = false; + public $echo_progress = false; function __construct($global_settings) { if(is_null($global_settings)){ @@ -63,7 +64,9 @@ include "root.php"; } function write_progress($message) { - echo "$message\n"; + if($this->echo_progress){ + echo "$message\n"; + } } //$options '-n' --no-clobber diff --git a/core/upgrade/index.php b/core/upgrade/index.php index d51b012718..376c7b54d8 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -53,7 +53,7 @@ if (sizeof($_POST) > 0) { // run source update if ($do["source"] && permission_exists("upgrade_source") && !is_dir("/usr/share/examples/fusionpbx")) { - chdir("/var/www/fusionpbx/"); + chdir($_SERVER["DOCUMENT_ROOT"]); exec("git pull", $response_source_update); $update_failed = true; if (sizeof($response_source_update) > 0) { diff --git a/resources/install/scripts/resources/functions/send_mail.lua b/resources/install/scripts/resources/functions/send_mail.lua index 52f8e647e4..430983ed2e 100644 --- a/resources/install/scripts/resources/functions/send_mail.lua +++ b/resources/install/scripts/resources/functions/send_mail.lua @@ -90,7 +90,7 @@ if freeswitch then if file then freeswitch.email(address, address, mail_headers, body, file) else - freeswitch.email(address, address, mail_headers, body, file) + freeswitch.email(address, address, mail_headers, body) end end end