diff --git a/app/switch/resources/dashboard/switch_status.php b/app/switch/resources/dashboard/switch_status.php index 2af47d09ee..956128d70b 100644 --- a/app/switch/resources/dashboard/switch_status.php +++ b/app/switch/resources/dashboard/switch_status.php @@ -6,13 +6,13 @@ //check permisions require_once "resources/check_auth.php"; - if (permission_exists("registration_all") || if_group("superadmin")) { + if (permission_exists("switch_version") + || permission_exists("switch_uptime") + || permission_exists("switch_channels") + || permission_exists("switch_registrations") + || permission_exists("registration_all")) { //access granted } - else { - echo "access denied"; - exit; - } //add multi-lingual support $language = new text; @@ -30,7 +30,7 @@ $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); //switch version - if ($fp) { + if (permission_exists('switch_version') && $fp) { $switch_version = event_socket_request($fp, 'api version'); preg_match("/FreeSWITCH Version (\d+\.\d+\.\d+(?:\.\d+)?).*\(.*?(\d+\w+)\s*\)/", $switch_version, $matches); $switch_version = $matches[1]; @@ -38,7 +38,7 @@ } //switch uptime - if ($fp) { + if (permission_exists('switch_uptime') && $fp) { $tmp = event_socket_request($fp, 'api status'); $tmp = explode("\n", $tmp); $tmp = $tmp[0]; @@ -54,7 +54,7 @@ } //channel count - if ($fp) { + if (permission_exists('switch_channels') && $fp) { $tmp = event_socket_request($fp, 'api status'); $matches = Array(); preg_match("/(\d+)\s+session\(s\)\s+\-\speak/", $tmp, $matches); @@ -65,12 +65,13 @@ } //registration count - if ($fp && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/registrations/")) { + if (permission_exists('switch_registrations') && file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/registrations/")) { $registration = new registrations; - $registrations = $registration->count(); - if (permission_exists("registration_all") || if_group("superadmin")) { + if (permission_exists("registration_all")) { + $registration->show = 'all'; $tr_link_registrations = "href='".PROJECT_PATH."/app/registrations/registrations.php'"; } + $registrations = $registration->count(); } //add doughnut chart @@ -131,7 +132,7 @@ echo "\n"; //switch version - if ($switch_version != '') { + if (permission_exists('switch_version') && $switch_version != '') { echo "