From ac49f1135d050d52382a8519b32bca084dbe5d0d Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 23 Mar 2015 17:26:47 +0000 Subject: [PATCH] Fax Server: Added permission to control Advanced section visibility. Addresses comment on r7943. --- app/fax/app_config.php | 4 ++++ app/fax/fax_edit.php | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/fax/app_config.php b/app/fax/app_config.php index 54efe79757..1207a50dac 100644 --- a/app/fax/app_config.php +++ b/app/fax/app_config.php @@ -41,6 +41,10 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "fax_extension_advanced"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "fax_inbox_view"; $apps[$x]['permissions'][$y]['menu']['uuid'] = "9c9642e4-2b9b-2785-18d0-6c0a4ede2b2f"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index a460e14e0a..d8bc032b30 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -254,7 +254,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "fax_destination_number, "; $sql .= "fax_name, "; $sql .= "fax_email, "; - if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_box_remote.php")) { $sql .= "fax_email_connection_type, "; $sql .= "fax_email_connection_host, "; $sql .= "fax_email_connection_port, "; @@ -284,7 +284,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$fax_destination_number', "; $sql .= "'$fax_name', "; $sql .= "'$fax_email', "; - if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_box_remote.php")) { $sql .= "'$fax_email_connection_type', "; $sql .= "'$fax_email_connection_host', "; $sql .= "'$fax_email_connection_port', "; @@ -323,7 +323,7 @@ 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', "; - if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_box_remote.php")) { $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', "; @@ -716,7 +716,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; echo " \n"; - if (function_exists("imap_open") && file_exists("fax_box_remote.php")) { + if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_box_remote.php")) { echo "\n"; } echo "
\n"; @@ -845,7 +845,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo ""; echo "
\n"; - if (function_exists("imap_open") && file_exists("fax_box_remote.php") && (if_group("admin") || if_group("superadmin"))) { + if (permission_exists('fax_extension_advanced') && function_exists("imap_open") && file_exists("fax_box_remote.php")) { echo "
\n";