From d9ab12eb5ce251057d25c1159c7f7a04a9a299c0 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Tue, 10 Mar 2015 20:31:45 +0000 Subject: [PATCH] Fax Server: Hide advanced settings for Users. --- app/fax/app_languages.php | 2 +- app/fax/fax_edit.php | 97 ++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/app/fax/app_languages.php b/app/fax/app_languages.php index 32a4dfaa71..04294c0998 100644 --- a/app/fax/app_languages.php +++ b/app/fax/app_languages.php @@ -203,7 +203,7 @@ $text['description-destination-number']['pt-pt'] = "Introduza o número de fax para onde pretende enviar."; $text['description-destination-number']['fr-fr'] = "Entrez le numéro de télécopie de destination."; - $text['description-email']['en-us'] = "Enter the email address to send the FAX to."; + $text['description-email']['en-us'] = "Enter a delivery address for inbound faxes."; $text['description-email']['es-cl'] = "Ingrese la dirección de email para enviar el fax."; $text['description-email']['pt-pt'] = "Introduza o endereço de email para enviar o fax."; $text['description-email']['fr-fr'] = "Choisir un courriel où envoyer le Fax."; diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 56fa420b1f..fa1d87653e 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -118,7 +118,6 @@ else { $fax_email_inbound_subject_tag = check_str($_POST["fax_email_inbound_subject_tag"]); $fax_email_outbound_subject_tag = check_str($_POST["fax_email_outbound_subject_tag"]); $fax_email_outbound_authorized_senders = $_POST["fax_email_outbound_authorized_senders"]; - //$fax_pin_number = check_str($_POST["fax_pin_number"]); $fax_caller_id_name = check_str($_POST["fax_caller_id_name"]); $fax_caller_id_number = check_str($_POST["fax_caller_id_number"]); $fax_forward_number = check_str($_POST["fax_forward_number"]); @@ -198,12 +197,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //check for all required data if (strlen($fax_extension) == 0) { $msg .= "".$text['confirm-ext']."
\n"; } if (strlen($fax_name) == 0) { $msg .= "".$text['confirm-fax']."
\n"; } - //if (strlen($fax_email) == 0) { $msg .= "Please provide: Email
\n"; } - //if (strlen($fax_pin_number) == 0) { $msg .= "Please provide: Pin Number
\n"; } - //if (strlen($fax_caller_id_name) == 0) { $msg .= "Please provide: Caller ID Name
\n"; } - //if (strlen($fax_caller_id_number) == 0) { $msg .= "Please provide: Caller ID Number
\n"; } - //if (strlen($fax_forward_number) == 0) { $msg .= "Please provide: Forward Number
\n"; } - //if (strlen($fax_description) == 0) { $msg .= "Please provide: Description
\n"; } if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { require_once "resources/header.php"; require_once "resources/persist_form_var.php"; @@ -261,18 +254,19 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "fax_destination_number, "; $sql .= "fax_name, "; $sql .= "fax_email, "; - $sql .= "fax_email_connection_type, "; - $sql .= "fax_email_connection_host, "; - $sql .= "fax_email_connection_port, "; - $sql .= "fax_email_connection_security, "; - $sql .= "fax_email_connection_validate, "; - $sql .= "fax_email_connection_username, "; - $sql .= "fax_email_connection_password, "; - $sql .= "fax_email_connection_mailbox, "; - $sql .= "fax_email_inbound_subject_tag, "; - $sql .= "fax_email_outbound_subject_tag, "; - $sql .= "fax_email_outbound_authorized_senders, "; - //$sql .= "fax_pin_number, "; + if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + $sql .= "fax_email_connection_type, "; + $sql .= "fax_email_connection_host, "; + $sql .= "fax_email_connection_port, "; + $sql .= "fax_email_connection_security, "; + $sql .= "fax_email_connection_validate, "; + $sql .= "fax_email_connection_username, "; + $sql .= "fax_email_connection_password, "; + $sql .= "fax_email_connection_mailbox, "; + $sql .= "fax_email_inbound_subject_tag, "; + $sql .= "fax_email_outbound_subject_tag, "; + $sql .= "fax_email_outbound_authorized_senders, "; + } $sql .= "fax_caller_id_name, "; $sql .= "fax_caller_id_number, "; if (strlen($fax_forward_number) > 0) { @@ -290,18 +284,19 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$fax_destination_number', "; $sql .= "'$fax_name', "; $sql .= "'$fax_email', "; - $sql .= "'$fax_email_connection_type', "; - $sql .= "'$fax_email_connection_host', "; - $sql .= "'$fax_email_connection_port', "; - $sql .= "'$fax_email_connection_security', "; - $sql .= "'$fax_email_connection_validate', "; - $sql .= "'$fax_email_connection_username', "; - $sql .= "'$fax_email_connection_password', "; - $sql .= "'$fax_email_connection_mailbox', "; - $sql .= "'$fax_email_inbound_subject_tag', "; - $sql .= "'$fax_email_outbound_subject_tag', "; - $sql .= "'$fax_email_outbound_authorized_senders', "; - //$sql .= "'$fax_pin_number', "; + if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + $sql .= "'$fax_email_connection_type', "; + $sql .= "'$fax_email_connection_host', "; + $sql .= "'$fax_email_connection_port', "; + $sql .= "'$fax_email_connection_security', "; + $sql .= "'$fax_email_connection_validate', "; + $sql .= "'$fax_email_connection_username', "; + $sql .= "'$fax_email_connection_password', "; + $sql .= "'$fax_email_connection_mailbox', "; + $sql .= "'$fax_email_inbound_subject_tag', "; + $sql .= "'$fax_email_outbound_subject_tag', "; + $sql .= "'$fax_email_outbound_authorized_senders', "; + } $sql .= "'$fax_caller_id_name', "; $sql .= "'$fax_caller_id_number', "; if (strlen($fax_forward_number) > 0) { @@ -328,18 +323,19 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "fax_destination_number = '$fax_destination_number', "; $sql .= "fax_name = '$fax_name', "; $sql .= "fax_email = '$fax_email', "; - $sql .= "fax_email_connection_type = '$fax_email_connection_type', "; - $sql .= "fax_email_connection_host = '$fax_email_connection_host', "; - $sql .= "fax_email_connection_port = '$fax_email_connection_port', "; - $sql .= "fax_email_connection_security = '$fax_email_connection_security', "; - $sql .= "fax_email_connection_validate = '$fax_email_connection_validate', "; - $sql .= "fax_email_connection_username = '$fax_email_connection_username', "; - $sql .= "fax_email_connection_password = '$fax_email_connection_password', "; - $sql .= "fax_email_connection_mailbox = '$fax_email_connection_mailbox', "; - $sql .= "fax_email_inbound_subject_tag = '$fax_email_inbound_subject_tag', "; - $sql .= "fax_email_outbound_subject_tag = '$fax_email_outbound_subject_tag', "; - $sql .= "fax_email_outbound_authorized_senders = '$fax_email_outbound_authorized_senders', "; - //$sql .= "fax_pin_number = '$fax_pin_number', "; + if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + $sql .= "fax_email_connection_type = '$fax_email_connection_type', "; + $sql .= "fax_email_connection_host = '$fax_email_connection_host', "; + $sql .= "fax_email_connection_port = '$fax_email_connection_port', "; + $sql .= "fax_email_connection_security = '$fax_email_connection_security', "; + $sql .= "fax_email_connection_validate = '$fax_email_connection_validate', "; + $sql .= "fax_email_connection_username = '$fax_email_connection_username', "; + $sql .= "fax_email_connection_password = '$fax_email_connection_password', "; + $sql .= "fax_email_connection_mailbox = '$fax_email_connection_mailbox', "; + $sql .= "fax_email_inbound_subject_tag = '$fax_email_inbound_subject_tag', "; + $sql .= "fax_email_outbound_subject_tag = '$fax_email_outbound_subject_tag', "; + $sql .= "fax_email_outbound_authorized_senders = '$fax_email_outbound_authorized_senders', "; + } $sql .= "fax_caller_id_name = '$fax_caller_id_name', "; $sql .= "fax_caller_id_number = '$fax_caller_id_number', "; if (strlen($fax_forward_number) > 0) { @@ -576,7 +572,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $fax_email_inbound_subject_tag = $row["fax_email_inbound_subject_tag"]; $fax_email_outbound_subject_tag = $row["fax_email_outbound_subject_tag"]; $fax_email_outbound_authorized_senders = $row["fax_email_outbound_authorized_senders"]; - //$fax_pin_number = $row["fax_pin_number"]; $fax_caller_id_name = $row["fax_caller_id_name"]; $fax_caller_id_number = $row["fax_caller_id_number"]; $fax_forward_number = $row["fax_forward_number"]; @@ -728,17 +723,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; - //echo "\n"; - //echo "\n"; - //echo " ".$text['label-pin']."\n"; - //echo "\n"; - //echo "\n"; - //echo " \n"; - //echo "
\n"; - //echo "".$text['description-pin']."\n"; - //echo "\n"; - //echo "\n"; - echo "\n"; echo "\n"; echo " ".$text['label-caller-id-name']."\n"; @@ -846,7 +830,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; - //echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -861,7 +844,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo ""; echo "
\n"; - if (function_exists("imap_open") && file_exists("fax_box_remote.php")) { + if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { echo "
\n";