diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 0ebe965af5..be326cc964 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -36,7 +36,7 @@ if (defined('STDIN')) { //add multi-lingual support $language = new text; - $text = $language->get($setting->get('domain','language','en-us'), 'app/fax'); + $text = $language->get($settings->get('domain','language','en-us'), 'app/fax'); } //executed via browser @@ -51,11 +51,6 @@ else { $domain_name = $_SESSION['domain_name']; $user_uuid = $_SESSION['user_uuid']; - //initialize the settings object - if (empty($settings)) { - $setting = new settings(["domain_uuid" => $domain_uuid]); - } - //check permissions if (permission_exists('fax_send')) { //access granted @@ -121,12 +116,12 @@ else { } //set the fax directory - if (!empty($setting->get('switch','storage'))) { - $fax_dir = $setting->get('switch','storage').'/fax/'.$domain_name; + if (!empty($settings->get('switch','storage'))) { + $fax_dir = $settings->get('switch','storage').'/fax/'.$domain_name; } //set fax cover font to generate pdf - $fax_cover_font = $setting->get('fax','cover_font') ?? null; + $fax_cover_font = $settings->get('fax','cover_font') ?? null; } //define function correct_path @@ -171,14 +166,14 @@ if (!function_exists('fax_split_dtmf')) { $dir_fax_temp = $fax_dir.'/'.$fax_extension.'/temp'; //make sure the directories exist - if (!empty($setting->get('switch','storage')) && !is_dir($setting->get('switch','storage'))) { - mkdir($setting->get('switch','storage'), 0770); + if (!empty($settings->get('switch','storage')) && !is_dir($settings->get('switch','storage'))) { + mkdir($settings->get('switch','storage'), 0770); } - if (!empty($setting->get('switch','storage')) && !is_dir($setting->get('switch','storage').'/fax')) { - mkdir($setting->get('switch','storage').'/fax', 0770); + if (!empty($settings->get('switch','storage')) && !is_dir($settings->get('switch','storage').'/fax')) { + mkdir($settings->get('switch','storage').'/fax', 0770); } - if (!empty($setting->get('switch','storage')) && !is_dir($setting->get('switch','storage').'/fax/'.$domain_name)) { - mkdir($setting->get('switch','storage').'/fax/'.$domain_name, 0770); + if (!empty($settings->get('switch','storage')) && !is_dir($settings->get('switch','storage').'/fax/'.$domain_name)) { + mkdir($settings->get('switch','storage').'/fax/'.$domain_name, 0770); } if (!is_dir($fax_dir.'/'.$fax_extension)) { mkdir($fax_dir.'/'.$fax_extension, 0770); @@ -301,7 +296,7 @@ if (!function_exists('fax_split_dtmf')) { } //un/authorized file extensions - $allowed_file_extensions = $setting->get('fax','allowed_extension'); + $allowed_file_extensions = $settings->get('fax','allowed_extension'); $disallowed_file_extensions = explode(',','sh,ssh,so,dll,exe,bat,vbs,zip,rar,z,tar,tbz,tgz,gz'); //process uploaded or emailed files (if any) @@ -410,19 +405,19 @@ if (!function_exists('fax_split_dtmf')) { //logo $display_logo = false; - if (empty($setting->get('fax','cover_logo'))) { + if (empty($settings->get('fax','cover_logo'))) { $logo = ''; //explicitly empty } - else if ($setting->get('fax','cover_logo') != '') { - if (substr($setting->get('fax','cover_logo'), 0, 4) == 'http') { - $logo = $setting->get('fax','cover_logo'); + else if ($settings->get('fax','cover_logo') != '') { + if (substr($settings->get('fax','cover_logo'), 0, 4) == 'http') { + $logo = $settings->get('fax','cover_logo'); } - else if (substr($setting->get('fax','cover_logo'), 0, 1) == '/') { - if (substr($setting->get('fax','cover_logo'), 0, strlen($_SERVER['DOCUMENT_ROOT'])) != $_SERVER['DOCUMENT_ROOT']) { - $logo = $_SERVER['DOCUMENT_ROOT'].$setting->get('fax','cover_logo'); + else if (substr($settings->get('fax','cover_logo'), 0, 1) == '/') { + if (substr($settings->get('fax','cover_logo'), 0, strlen($_SERVER['DOCUMENT_ROOT'])) != $_SERVER['DOCUMENT_ROOT']) { + $logo = $_SERVER['DOCUMENT_ROOT'].$settings->get('fax','cover_logo'); } else { - $logo = $setting->get('fax','cover_logo'); + $logo = $settings->get('fax','cover_logo'); } } } @@ -497,7 +492,7 @@ if (!function_exists('fax_split_dtmf')) { $pdf->SetFont($pdf_font, "", 12); $pdf->SetXY($x + 2.0, $y + 1.65); if (defined('STDIN') || ($_REQUEST['submit'] != '' && $_REQUEST['submit'] != 'preview')) { - $date = new DateTime('now', new DateTimeZone( $setting->get('domain','time_zone', date_default_timezone_get() ) )); + $date = new DateTime('now', new DateTimeZone( $settings->get('domain','time_zone', date_default_timezone_get() ) )); $pdf->Write(0.3, $date->format('d M Y @ h:i:s A')); } $pdf->SetXY($x + 2.0, $y + 1.95); @@ -671,7 +666,7 @@ if (!function_exists('fax_split_dtmf')) { } //prepare variables send the fax - $mail_from_address = (!empty($setting->get('fax','smtp_from'))) ? $setting->get('fax','smtp_from') : $setting->get('email','smtp_from'); + $mail_from_address = (!empty($settings->get('fax','smtp_from'))) ? $settings->get('fax','smtp_from') : $settings->get('email','smtp_from'); //get the fax mail to address and fax prefix $sql = "select * from v_fax where fax_uuid = :fax_uuid "; @@ -774,7 +769,7 @@ if (!function_exists('fax_split_dtmf')) { //send the external call $fax_variables = ''; - foreach($setting->get('fax','variable') as $variable) { + foreach($settings->get('fax','variable') as $variable) { $fax_variables .= $variable.","; } } @@ -865,7 +860,7 @@ if (!defined('STDIN')) { $sql .= "and cp.phone_type_fax = 1 "; $sql .= "and cp.phone_number is not null "; $sql .= "and cp.phone_number <> '' "; - if ($setting->get('contact','permissions', false)) { + if ($settings->get('contact','permissions', false)) { if (is_array($user_group_uuids) && @sizeof($user_group_uuids) != 0) { //only show contacts assigned to current user's group(s) and those not assigned to any group $sql .= "and ("; @@ -981,7 +976,7 @@ if (!defined('STDIN')) { echo "
\n"; echo "
".$text['header-new_fax']."
\n"; echo "
\n"; - echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$setting->get('theme','button_icon_back'),'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'fax.php']); + echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme','button_icon_back'),'id'=>'btn_back','style'=>'margin-right: 15px;','link'=>'fax.php']); if ($domain_enabled == true) { echo button::create(['type'=>'submit','label'=>$text['button-preview'],'icon'=>'eye','name'=>'submit','value'=>'preview']); echo button::create(['type'=>'submit','label'=>$text['button-send'],'icon'=>'paper-plane','id'=>'btn_save','name'=>'submit','value'=>'send','style'=>'margin-left: 15px;']); @@ -1004,7 +999,7 @@ if (!defined('STDIN')) { echo " ".$text['label-fax-header']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-fax-header']."\n"; echo "\n"; @@ -1072,7 +1067,7 @@ if (!defined('STDIN')) { for ($f = 1; $f <= 3; $f++) { echo " 1) ? "style='display: none;'" : null).">"; echo " "; - echo button::create(['type'=>'button','label'=>$text['button-clear'],'icon'=>$setting->get('theme','button_icon_reset'),'onclick'=>"reset_file_input('fax_files_".$f."'); document.getElementById('file_list_".$f."').innerHTML='';"]); + echo button::create(['type'=>'button','label'=>$text['button-clear'],'icon'=>$settings->get('theme','button_icon_reset'),'onclick'=>"reset_file_input('fax_files_".$f."'); document.getElementById('file_list_".$f."').innerHTML='';"]); echo "
"; echo " "; echo "
\n"; @@ -1087,9 +1082,9 @@ if (!defined('STDIN')) { echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo " ".$text['description-fax-resolution']."\n"; @@ -1102,9 +1097,9 @@ if (!defined('STDIN')) { echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo " ".$text['description-fax-page-size']."\n"; @@ -1112,7 +1107,7 @@ if (!defined('STDIN')) { echo "\n"; if (permission_exists('fax_subject')) { - $cover_subject_required = $setting->get('fax','cover_subject_required') ?? ''; + $cover_subject_required = $settings->get('fax','cover_subject_required') ?? ''; $class = ($cover_subject_required == 'true') ? 'vncellreq' : 'vncell'; $required = ($cover_subject_required == 'true') ? 'required' : ''; echo "\n"; @@ -1128,7 +1123,7 @@ if (!defined('STDIN')) { } if (permission_exists('fax_message')) { - $cover_message_required = $setting->get('fax','cover_message_required') ?? ''; + $cover_message_required = $settings->get('fax','cover_message_required') ?? ''; $class = ($cover_message_required == 'true') ? 'vncellreq' : 'vncell'; $required = ($cover_message_required == 'true') ? 'required' : ''; echo "\n"; @@ -1149,7 +1144,7 @@ if (!defined('STDIN')) { echo " ".$text['label-fax-footer']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-fax-footer']."\n"; echo "\n";