diff --git a/app/access_controls/access_control_export.php b/app/access_controls/access_control_export.php index e52e0bf52e..32d0ccf48e 100644 --- a/app/access_controls/access_control_export.php +++ b/app/access_controls/access_control_export.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('access_control_node_view')) { - //access granted - } - else { + if (!permission_exists('access_control_node_view')) { echo "access denied"; exit; } diff --git a/app/access_controls/access_control_import.php b/app/access_controls/access_control_import.php index 6059544372..83c780e647 100644 --- a/app/access_controls/access_control_import.php +++ b/app/access_controls/access_control_import.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('access_control_node_add')) { - //access granted - } - else { + if (!permission_exists('access_control_node_add')) { echo "access denied"; exit; } diff --git a/app/access_controls/access_controls.php b/app/access_controls/access_controls.php index a45db3c146..3a3d14b60e 100644 --- a/app/access_controls/access_controls.php +++ b/app/access_controls/access_controls.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('access_control_view')) { - //access granted - } - else { + if (!permission_exists('access_control_view')) { echo "access denied"; exit; } @@ -66,12 +63,6 @@ $obj->copy($access_controls); } break; - case 'toggle': - if (permission_exists('access_control_edit')) { - $obj = new access_controls; - $obj->toggle($access_controls); - } - break; case 'delete': if (permission_exists('access_control_delete')) { $obj = new access_controls; diff --git a/app/access_controls/access_controls_reload.php b/app/access_controls/access_controls_reload.php index ea6304338d..31d3017228 100644 --- a/app/access_controls/access_controls_reload.php +++ b/app/access_controls/access_controls_reload.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('access_control_view')) { - //access granted - } - else { + if (!permission_exists('access_control_view')) { echo "access denied"; exit; } diff --git a/app/active_calls/active_calls.php b/app/active_calls/active_calls.php index 116ecc5197..45abafc79c 100644 --- a/app/active_calls/active_calls.php +++ b/app/active_calls/active_calls.php @@ -30,9 +30,7 @@ require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions -if (permission_exists('call_active_view')) { - //access granted -} else { +if (!permission_exists('call_active_view')) { echo "access denied"; exit; } diff --git a/app/basic_operator_panel/autocomplete.php b/app/basic_operator_panel/autocomplete.php index 1d5e92b05a..17280e84d0 100644 --- a/app/basic_operator_panel/autocomplete.php +++ b/app/basic_operator_panel/autocomplete.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_view')) { - //access granted - } - else { + if (!permission_exists('contact_view')) { exit; } diff --git a/app/basic_operator_panel/exec.php b/app/basic_operator_panel/exec.php index 27275597cc..3d88eb88a1 100644 --- a/app/basic_operator_panel/exec.php +++ b/app/basic_operator_panel/exec.php @@ -32,10 +32,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('operator_panel_view')) { - //access granted - } - else { + if (!permission_exists('operator_panel_view')) { echo "access denied"; exit; } diff --git a/app/basic_operator_panel/index.php b/app/basic_operator_panel/index.php index 76b0aa1943..5091b3d235 100644 --- a/app/basic_operator_panel/index.php +++ b/app/basic_operator_panel/index.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('operator_panel_view')) { - //access granted - } - else { + if (!permission_exists('operator_panel_view')) { echo "access denied"; exit; } diff --git a/app/basic_operator_panel/resources/content.php b/app/basic_operator_panel/resources/content.php index e9e5f47f43..4fc018594f 100644 --- a/app/basic_operator_panel/resources/content.php +++ b/app/basic_operator_panel/resources/content.php @@ -29,10 +29,7 @@ require_once dirname(__DIR__, 3) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions -if (permission_exists('operator_panel_view')) { - //access granted -} -else { +if (!permission_exists('operator_panel_view')) { echo "access denied"; exit; } diff --git a/app/bridges/bridge_imports.php b/app/bridges/bridge_imports.php index 83ea7b4cc7..5eb7598dd0 100644 --- a/app/bridges/bridge_imports.php +++ b/app/bridges/bridge_imports.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('bridge_import')) { - //access granted - } - else { + if (!permission_exists('bridge_import')) { echo "access denied"; exit; } diff --git a/app/bridges/bridges.php b/app/bridges/bridges.php index 482d7366e4..85a455386e 100644 --- a/app/bridges/bridges.php +++ b/app/bridges/bridges.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('bridge_view')) { - //access granted - } - else { + if (!permission_exists('bridge_view')) { echo "access denied"; exit; } diff --git a/app/call_block/call_block.php b/app/call_block/call_block.php index 418516a320..cdd9bece1a 100644 --- a/app/call_block/call_block.php +++ b/app/call_block/call_block.php @@ -34,7 +34,8 @@ //check permissions if (!permission_exists('call_block_view')) { - echo "access denied"; exit; + echo "access denied"; + exit; } //add multi-lingual support diff --git a/app/call_block/call_block_edit.php b/app/call_block/call_block_edit.php index 2487cbe73e..a3bef66ead 100644 --- a/app/call_block/call_block_edit.php +++ b/app/call_block/call_block_edit.php @@ -33,7 +33,8 @@ //check permissions if (!permission_exists('call_block_edit') && !permission_exists('call_block_add')) { - echo "access denied"; exit; + echo "access denied"; + exit; } //add multi-lingual support diff --git a/app/call_broadcast/call_broadcast.php b/app/call_broadcast/call_broadcast.php index b79529b692..64b86b06c2 100644 --- a/app/call_broadcast/call_broadcast.php +++ b/app/call_broadcast/call_broadcast.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('call_broadcast_view')) { - //access granted - } - else { + if (!permission_exists('call_broadcast_view')) { echo "access denied"; exit; } diff --git a/app/call_broadcast/call_broadcast_edit.php b/app/call_broadcast/call_broadcast_edit.php index f928321907..bd988bf71b 100644 --- a/app/call_broadcast/call_broadcast_edit.php +++ b/app/call_broadcast/call_broadcast_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_broadcast_edit')) { - //access granted - } - else { + if (!permission_exists('call_broadcast_edit')) { echo "access denied"; exit; } @@ -76,7 +73,7 @@ { $count++; if ($count == 1) { continue; } - $getData = preg_split('/[ ,|]/', $getData[0], null, PREG_SPLIT_NO_EMPTY); + $getData = preg_split('/[ ,|]/', $getData[0], '', PREG_SPLIT_NO_EMPTY); $separator = $getData[0]; $separator .= (isset($getData[1]) && $getData[1] != '')? '|'.$getData[1] : ''; $separator .= (isset($getData[2]) && $getData[2] != '')? ','.$getData[2] : ''; diff --git a/app/call_center_active/call_center_active.php b/app/call_center_active/call_center_active.php index 95e642744a..dcc557e45d 100644 --- a/app/call_center_active/call_center_active.php +++ b/app/call_center_active/call_center_active.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_active_view')) { - //access granted - } - else { + if (!permission_exists('call_center_active_view')) { echo "access denied"; exit; } diff --git a/app/call_center_active/call_center_active_inc.php b/app/call_center_active/call_center_active_inc.php index 7e3b05db0f..a20ae39e95 100644 --- a/app/call_center_active/call_center_active_inc.php +++ b/app/call_center_active/call_center_active_inc.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_active_view')) { - //access granted - } - else { + if (!permission_exists('call_center_active_view')) { echo "access denied"; exit; } diff --git a/app/call_center_active/call_center_exec.php b/app/call_center_active/call_center_exec.php index bd476d2c7c..7061705e39 100644 --- a/app/call_center_active/call_center_exec.php +++ b/app/call_center_active/call_center_exec.php @@ -32,10 +32,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_active_options')) { - //access granted - } - else { + if (!permission_exists('call_center_active_options')) { echo "access denied"; exit; } @@ -53,7 +50,7 @@ if (!is_numeric($extension)) { $extension = null; } - + //validate the uuid if (!is_uuid($uuid)) { $uuid = null; diff --git a/app/call_center_active/call_center_queue.php b/app/call_center_active/call_center_queue.php index 9d58ab5048..ae31405208 100644 --- a/app/call_center_active/call_center_queue.php +++ b/app/call_center_active/call_center_queue.php @@ -29,10 +29,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('call_center_active_view')) { - //access granted - } - else { + if (!permission_exists('call_center_active_view')) { echo "access denied"; exit; } diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php index da81a3b56d..d8952b3af5 100644 --- a/app/call_centers/call_center_agent_edit.php +++ b/app/call_centers/call_center_agent_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_agent_add') || permission_exists('call_center_agent_edit')) { - //access granted - } - else { + if (!permission_exists('call_center_agent_add') || !permission_exists('call_center_agent_edit')) { echo "access denied"; exit; } diff --git a/app/call_centers/call_center_agent_status.php b/app/call_centers/call_center_agent_status.php index 149165bdef..643af420e7 100644 --- a/app/call_centers/call_center_agent_status.php +++ b/app/call_centers/call_center_agent_status.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('call_center_agent_view')) { - //access granted - } - else { + if (!permission_exists('call_center_agent_view')) { echo "access denied"; exit; } diff --git a/app/call_centers/call_center_agents.php b/app/call_centers/call_center_agents.php index 5c9b73bd1a..f19137c4af 100644 --- a/app/call_centers/call_center_agents.php +++ b/app/call_centers/call_center_agents.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('call_center_agent_view')) { - //access granted - } - else { + if (!permission_exists('call_center_agent_view')) { echo "access denied"; exit; } diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index d2abb4e1d2..c8dc7c8202 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_queue_add') || permission_exists('call_center_queue_edit')) { - //access granted - } - else { + if (!permission_exists('call_center_queue_add') || !permission_exists('call_center_queue_edit')) { echo "access denied"; exit; } diff --git a/app/call_centers/cmd.php b/app/call_centers/cmd.php index 573a3d543c..4171dff8c4 100644 --- a/app/call_centers/cmd.php +++ b/app/call_centers/cmd.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_queue_add') || permission_exists('call_center_queue_edit')) { - //access granted - } - else { + if (!permission_exists('call_center_queue_add') || !permission_exists('call_center_queue_edit')) { echo "access denied"; exit; } diff --git a/app/call_centers/resources/dashboard/call_center_agents.php b/app/call_centers/resources/dashboard/call_center_agents.php index 29c4295e0e..a3749817af 100644 --- a/app/call_centers/resources/dashboard/call_center_agents.php +++ b/app/call_centers/resources/dashboard/call_center_agents.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_center_queue_view')) { - //access granted - } - else { + if (!permission_exists('call_center_queue_view')) { echo "access denied"; exit; } diff --git a/app/call_flows/call_flow_edit.php b/app/call_flows/call_flow_edit.php index 4595f55dc5..0399366b38 100644 --- a/app/call_flows/call_flow_edit.php +++ b/app/call_flows/call_flow_edit.php @@ -30,10 +30,7 @@ //check permissions require_once "resources/check_auth.php"; - if (permission_exists('call_flow_add') || permission_exists('call_flow_edit')) { - //access granted - } - else { + if (!permission_exists('call_flow_add') || !permission_exists('call_flow_edit')) { echo "access denied"; exit; } diff --git a/app/call_flows/call_flows.php b/app/call_flows/call_flows.php index 9e6b25cbfb..a7a5b165c7 100644 --- a/app/call_flows/call_flows.php +++ b/app/call_flows/call_flows.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_flow_view')) { - //access granted - } - else { + if (!permission_exists('call_flow_view')) { echo "access denied"; exit; } diff --git a/app/call_forward/call_forward.php b/app/call_forward/call_forward.php index 38b6f241e6..8ace35f704 100644 --- a/app/call_forward/call_forward.php +++ b/app/call_forward/call_forward.php @@ -34,10 +34,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) { - //access granted - } - else { + if (!permission_exists('follow_me') || !permission_exists('call_forward') || !permission_exists('do_not_disturb')) { echo "access denied"; exit; } diff --git a/app/call_forward/call_forward_edit.php b/app/call_forward/call_forward_edit.php index cc644b6b2a..f4f0316d9d 100644 --- a/app/call_forward/call_forward_edit.php +++ b/app/call_forward/call_forward_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) { - //access granted - } - else { + if (!permission_exists('follow_me') || !permission_exists('call_forward') || !permission_exists('do_not_disturb')) { echo "access denied"; exit; } diff --git a/app/call_forward/resources/dashboard/call_forward.php b/app/call_forward/resources/dashboard/call_forward.php index 5a21419778..c9efc7de5c 100644 --- a/app/call_forward/resources/dashboard/call_forward.php +++ b/app/call_forward/resources/dashboard/call_forward.php @@ -2,13 +2,10 @@ //includes files require_once dirname(__DIR__, 4) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('follow_me') || permission_exists('call_forward') || permission_exists('do_not_disturb')) { - //access granted - } - else { + if (!permission_exists('follow_me') || !permission_exists('call_forward') || !permission_exists('do_not_disturb')) { echo "access denied"; exit; } diff --git a/app/call_recordings/call_recordings.php b/app/call_recordings/call_recordings.php index 72d9b1341e..73f55f2ec9 100644 --- a/app/call_recordings/call_recordings.php +++ b/app/call_recordings/call_recordings.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('call_recording_view')) { - //access granted - } - else { + if (!permission_exists('call_recording_view')) { echo "access denied"; exit; } diff --git a/app/calls_active/calls_active.php b/app/calls_active/calls_active.php index 4f85a51bf3..54770a194a 100644 --- a/app/calls_active/calls_active.php +++ b/app/calls_active/calls_active.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_active_view')) { - //access granted - } - else { + if (!permission_exists('call_active_view')) { echo "access denied"; exit; } diff --git a/app/calls_active/calls_active_inc.php b/app/calls_active/calls_active_inc.php index 91a58003d4..0f2f74e5d0 100644 --- a/app/calls_active/calls_active_inc.php +++ b/app/calls_active/calls_active_inc.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_active_view')) { - //access granted - } - else { + if (!permission_exists('call_active_view')) { echo "access denied"; exit; } diff --git a/app/calls_active/calls_exec.php b/app/calls_active/calls_exec.php index db1cf63e6d..f12afed89d 100644 --- a/app/calls_active/calls_exec.php +++ b/app/calls_active/calls_exec.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('call_active_view')) { - //access granted - } - else { + if (!permission_exists('call_active_view')) { echo "access denied"; exit; } diff --git a/app/click_to_call/click_to_call.php b/app/click_to_call/click_to_call.php index b71c4efa9e..eab2a311ab 100644 --- a/app/click_to_call/click_to_call.php +++ b/app/click_to_call/click_to_call.php @@ -35,10 +35,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('click_to_call_view')) { - //access granted - } - else { + if (!permission_exists('click_to_call_view')) { echo "access denied"; exit; } diff --git a/app/conference_centers/conference_center_edit.php b/app/conference_centers/conference_center_edit.php index 81ad8bc355..8121c891e6 100644 --- a/app/conference_centers/conference_center_edit.php +++ b/app/conference_centers/conference_center_edit.php @@ -26,13 +26,10 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('conference_center_add') || permission_exists('conference_center_edit')) { - //access granted - } - else { + if (!permission_exists('conference_center_add') || !permission_exists('conference_center_edit')) { echo "access denied"; exit; } diff --git a/app/conference_centers/conference_centers.php b/app/conference_centers/conference_centers.php index 4e5760368d..9e07f75d1e 100644 --- a/app/conference_centers/conference_centers.php +++ b/app/conference_centers/conference_centers.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_center_view')) { - //access granted - } - else { + if (!permission_exists('conference_center_view')) { echo "access denied"; exit; } diff --git a/app/conference_centers/conference_room_edit.php b/app/conference_centers/conference_room_edit.php index f07583aabf..dd60bc4d3b 100644 --- a/app/conference_centers/conference_room_edit.php +++ b/app/conference_centers/conference_room_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_room_add') || permission_exists('conference_room_edit')) { - //access granted - } - else { + if (!permission_exists('conference_room_add') || !permission_exists('conference_room_edit')) { echo "access denied"; exit; } diff --git a/app/conference_centers/conference_rooms.php b/app/conference_centers/conference_rooms.php index 1636d31033..3bd3e112e2 100644 --- a/app/conference_centers/conference_rooms.php +++ b/app/conference_centers/conference_rooms.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_room_view')) { - //access granted - } - else { + if (!permission_exists('conference_room_view')) { echo "access denied"; exit; } diff --git a/app/conference_centers/conference_session_details.php b/app/conference_centers/conference_session_details.php index 6b53e14432..22fa6d5215 100644 --- a/app/conference_centers/conference_session_details.php +++ b/app/conference_centers/conference_session_details.php @@ -29,10 +29,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_session_view')) { - //access granted - } - else { + if (!permission_exists('conference_session_view')) { echo "access denied"; exit; } diff --git a/app/conference_centers/conference_sessions.php b/app/conference_centers/conference_sessions.php index c177c6d612..3f61e29a8b 100644 --- a/app/conference_centers/conference_sessions.php +++ b/app/conference_centers/conference_sessions.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_session_view')) { - //access granted - } - else { + if (!permission_exists('conference_session_view')) { echo "access denied"; exit; } diff --git a/app/conference_controls/conference_control_detail_edit.php b/app/conference_controls/conference_control_detail_edit.php index be51a5dc79..392bf147db 100644 --- a/app/conference_controls/conference_control_detail_edit.php +++ b/app/conference_controls/conference_control_detail_edit.php @@ -26,13 +26,10 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('conference_control_detail_add') || permission_exists('conference_control_detail_edit')) { - //access granted - } - else { + if (!permission_exists('conference_control_detail_add') || !permission_exists('conference_control_detail_edit')) { echo "access denied"; exit; } diff --git a/app/conference_controls/conference_control_details.php b/app/conference_controls/conference_control_details.php index fc6a83fea4..5ed9c180ff 100644 --- a/app/conference_controls/conference_control_details.php +++ b/app/conference_controls/conference_control_details.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_control_detail_view')) { - //access granted - } - else { + if (!permission_exists('conference_control_detail_view')) { echo "access denied"; exit; } diff --git a/app/conference_controls/conference_control_edit.php b/app/conference_controls/conference_control_edit.php index 94878d2603..d4fda16e74 100644 --- a/app/conference_controls/conference_control_edit.php +++ b/app/conference_controls/conference_control_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_control_add') || permission_exists('conference_control_edit')) { - //access granted - } - else { + if (!permission_exists('conference_control_add') || !permission_exists('conference_control_edit')) { echo "access denied"; exit; } diff --git a/app/conference_controls/conference_controls.php b/app/conference_controls/conference_controls.php index 5afb27bc2d..4c9db3b54f 100644 --- a/app/conference_controls/conference_controls.php +++ b/app/conference_controls/conference_controls.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_control_view')) { - //access granted - } - else { + if (!permission_exists('conference_control_view')) { echo "access denied"; exit; } diff --git a/app/conference_profiles/conference_profile_edit.php b/app/conference_profiles/conference_profile_edit.php index 55ecddb611..ea23399a30 100644 --- a/app/conference_profiles/conference_profile_edit.php +++ b/app/conference_profiles/conference_profile_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_profile_add') || permission_exists('conference_profile_edit')) { - //access granted - } - else { + if (!permission_exists('conference_profile_add') || !permission_exists('conference_profile_edit')) { echo "access denied"; exit; } diff --git a/app/conference_profiles/conference_profile_param_edit.php b/app/conference_profiles/conference_profile_param_edit.php index 9e16d6a58e..4eed1646d3 100644 --- a/app/conference_profiles/conference_profile_param_edit.php +++ b/app/conference_profiles/conference_profile_param_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_profile_param_add') || permission_exists('conference_profile_param_edit')) { - //access granted - } - else { + if (!permission_exists('conference_profile_param_add') || !permission_exists('conference_profile_param_edit')) { echo "access denied"; exit; } diff --git a/app/conference_profiles/conference_profile_params.php b/app/conference_profiles/conference_profile_params.php index 283f80e1a3..f048c70de8 100644 --- a/app/conference_profiles/conference_profile_params.php +++ b/app/conference_profiles/conference_profile_params.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_profile_param_view')) { - //access granted - } - else { + if (!permission_exists('conference_profile_param_view')) { echo "access denied"; exit; } diff --git a/app/conference_profiles/conference_profiles.php b/app/conference_profiles/conference_profiles.php index b51b1997fe..1256c14e42 100644 --- a/app/conference_profiles/conference_profiles.php +++ b/app/conference_profiles/conference_profiles.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_profile_view')) { - //access granted - } - else { + if (!permission_exists('conference_profile_view')) { echo "access denied"; exit; } diff --git a/app/conferences/conference_edit.php b/app/conferences/conference_edit.php index d19697ecf9..a45e8eb338 100644 --- a/app/conferences/conference_edit.php +++ b/app/conferences/conference_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_add') || permission_exists('conference_edit')) { - //access granted - } - else { + if (!permission_exists('conference_add') || !permission_exists('conference_edit')) { echo "access denied"; exit; } diff --git a/app/conferences/conferences.php b/app/conferences/conferences.php index 69549b2080..7bbd943e26 100644 --- a/app/conferences/conferences.php +++ b/app/conferences/conferences.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('conference_view')) { - //access granted - } - else { + if (!permission_exists('conference_view')) { echo "access denied"; exit; } diff --git a/app/conferences_active/conference_exec.php b/app/conferences_active/conference_exec.php index a9c1159717..03d6f395f9 100644 --- a/app/conferences_active/conference_exec.php +++ b/app/conferences_active/conference_exec.php @@ -41,10 +41,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_active_view')) { - //access granted - } - else { + if (!permission_exists('conference_active_view')) { echo "access denied"; exit; } diff --git a/app/conferences_active/conference_interactive.php b/app/conferences_active/conference_interactive.php index 2389303da3..53f042f098 100644 --- a/app/conferences_active/conference_interactive.php +++ b/app/conferences_active/conference_interactive.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_interactive_view')) { - //access granted - } - else { + if (!permission_exists('conference_interactive_view')) { echo "access denied"; exit; } diff --git a/app/conferences_active/conference_interactive_inc.php b/app/conferences_active/conference_interactive_inc.php index 2170dea63f..e9a26d77c9 100644 --- a/app/conferences_active/conference_interactive_inc.php +++ b/app/conferences_active/conference_interactive_inc.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_interactive_view')) { - //access granted - } - else { + if (!permission_exists('conference_interactive_view')) { echo "access denied"; exit; } diff --git a/app/conferences_active/conferences_active.php b/app/conferences_active/conferences_active.php index 2b4e2c7606..439f275d9b 100644 --- a/app/conferences_active/conferences_active.php +++ b/app/conferences_active/conferences_active.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_active_view')) { - //access granted - } - else { + if (!permission_exists('conference_active_view')) { echo "access denied"; exit; } diff --git a/app/conferences_active/conferences_active_inc.php b/app/conferences_active/conferences_active_inc.php index 96cdd52100..bdd618b28d 100644 --- a/app/conferences_active/conferences_active_inc.php +++ b/app/conferences_active/conferences_active_inc.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('conference_active_view')) { - //access granted - } - else { + if (!permission_exists('conference_active_view')) { echo "access denied"; exit; } diff --git a/app/database_transactions/database_transaction_edit.php b/app/database_transactions/database_transaction_edit.php index 7b52094668..327a7ade46 100644 --- a/app/database_transactions/database_transaction_edit.php +++ b/app/database_transactions/database_transaction_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('database_transaction_add') || permission_exists('database_transaction_edit')) { - //access granted - } - else { + if (!permission_exists('database_transaction_add') || !permission_exists('database_transaction_edit')) { echo "access denied"; exit; } diff --git a/app/database_transactions/database_transactions.php b/app/database_transactions/database_transactions.php index 4b477b7a79..0b0c678496 100644 --- a/app/database_transactions/database_transactions.php +++ b/app/database_transactions/database_transactions.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('database_transaction_view')) { - //access granted - } - else { + if (!permission_exists('database_transaction_view')) { echo "access denied"; exit; } diff --git a/app/destinations/destination_download.php b/app/destinations/destination_download.php index 8bd5e8d8bc..034bd23782 100644 --- a/app/destinations/destination_download.php +++ b/app/destinations/destination_download.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('destination_export')) { - //access granted - } - else { + if (!permission_exists('destination_export')) { echo "access denied"; exit; } diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 34ecc5d146..b1199e2905 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('destination_add') || permission_exists('destination_edit')) { - //access granted - } - else { + if (!permission_exists('destination_add') || !permission_exists('destination_edit')) { echo "access denied"; exit; } @@ -577,8 +574,8 @@ if (isset($action_array[0]) && !empty($action_array[0])) { if ($destination->valid($action_array[0].':'.$action_array[1])) { //set variables from the action array - $action_app = $action_array[0]; - $action_data = $action_array[1]; + $action_app = $action_array[0] ?? ''; + $action_data = $action_array[1] ?? ''; //allow specific api commands $allowed_commands = array(); @@ -589,7 +586,7 @@ } $action_data = xml::sanitize($action_data); foreach ($allowed_commands as $allowed_command) { - $action_data = str_replace('#{'.$allowed_command, '${'.$allowed_command, $action_data); + $action_data = str_replace('#{'.$allowed_command, '${'.$allowed_command, $action_data ?? ''); } //add the action to the dialplan xml diff --git a/app/destinations/destination_imports.php b/app/destinations/destination_imports.php index eb63ed7c81..9c408c8db7 100644 --- a/app/destinations/destination_imports.php +++ b/app/destinations/destination_imports.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('destination_import')) { - //access granted - } - else { + if (!permission_exists('destination_import')) { echo "access denied"; exit; } diff --git a/app/destinations/destination_summary.php b/app/destinations/destination_summary.php index 1483fae101..ce27dc44a9 100644 --- a/app/destinations/destination_summary.php +++ b/app/destinations/destination_summary.php @@ -30,10 +30,7 @@ //require_once "resources/paging.php"; //check permissions - if (permission_exists('destination_view')) { - //access granted - } - else { + if (!permission_exists('destination_view')) { echo "access denied"; exit; } diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index 35e093d17d..b2dbdd6c21 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('destination_view')) { - //access granted - } - else { + if (!permission_exists('destination_view')) { echo "access denied"; exit; } @@ -65,12 +62,6 @@ //process the http post data by action if (!empty($action) && !empty($destinations)) { switch ($action) { - case 'toggle': - if (permission_exists('destination_edit')) { - $obj = new destinations; - $obj->toggle($destinations); - } - break; case 'delete': if (permission_exists('destination_delete')) { $obj = new destinations; diff --git a/app/destinations/resources/destinations.php b/app/destinations/resources/destinations.php index be44fd7735..c309550782 100644 --- a/app/destinations/resources/destinations.php +++ b/app/destinations/resources/destinations.php @@ -5,10 +5,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('destination_view')) { - //access granted - } - else { + if (!permission_exists('destination_view')) { echo "access denied"; exit; } diff --git a/app/devices/cmd.php b/app/devices/cmd.php index e3daf6d0e9..9daa4304ef 100644 --- a/app/devices/cmd.php +++ b/app/devices/cmd.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists("device_key_add") || permission_exists("device_key_edit") || if_group("superadmin")) { - //access granted - } - else { + if (!permission_exists("device_key_add") || !permission_exists("device_key_edit")) { echo "access denied"; exit; } diff --git a/app/devices/device_copy.php b/app/devices/device_copy.php index e5f4997fe3..d7e8a5a9d9 100644 --- a/app/devices/device_copy.php +++ b/app/devices/device_copy.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('device_add')) { - //access granted - } - else { + if (!permission_exists('device_add')) { echo "access denied"; exit; } diff --git a/app/devices/device_download.php b/app/devices/device_download.php index 82dbc5d009..5b341772ec 100644 --- a/app/devices/device_download.php +++ b/app/devices/device_download.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('device_export')) { - //access granted - } - else { + if (!permission_exists('device_export')) { echo "access denied"; exit; } diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 6e66ffd7e0..f49b796220 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -27,10 +27,7 @@ //check permissions require_once "resources/check_auth.php"; - if (permission_exists('device_add') || permission_exists('device_edit')) { - //access granted - } - else { + if (!permission_exists('device_add') || !permission_exists('device_edit')) { echo "access denied"; exit; } diff --git a/app/devices/device_imports.php b/app/devices/device_imports.php index a1ff3848b8..af50f49496 100644 --- a/app/devices/device_imports.php +++ b/app/devices/device_imports.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('device_add')) { - //access granted - } - else { + if (!permission_exists('device_add')) { echo "access denied"; exit; } diff --git a/app/devices/device_profile_copy.php b/app/devices/device_profile_copy.php index e5b50e3f49..7c1ef4f513 100644 --- a/app/devices/device_profile_copy.php +++ b/app/devices/device_profile_copy.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('device_profile_add')) { - //access granted - } - else { + if (!permission_exists('device_profile_add')) { echo "access denied"; exit; } diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index 1ee7814061..49cbcd7f8d 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -25,13 +25,10 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('device_profile_add') || permission_exists('device_profile_edit')) { - //access granted - } - else { + if (!permission_exists('device_profile_add') || !permission_exists('device_profile_edit')) { echo "access denied"; exit; } diff --git a/app/devices/device_profiles.php b/app/devices/device_profiles.php index 6274c0afc9..f3a9425536 100644 --- a/app/devices/device_profiles.php +++ b/app/devices/device_profiles.php @@ -29,10 +29,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('device_profile_view')) { - //access granted - } - else { + if (!permission_exists('device_profile_view')) { echo "access denied"; exit; } diff --git a/app/devices/device_vendor_edit.php b/app/devices/device_vendor_edit.php index 2d212aa6ad..2501ed9c1f 100644 --- a/app/devices/device_vendor_edit.php +++ b/app/devices/device_vendor_edit.php @@ -26,13 +26,10 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('device_vendor_add') || permission_exists('device_vendor_edit')) { - //access granted - } - else { + if (!permission_exists('device_vendor_add') || !permission_exists('device_vendor_edit')) { echo "access denied"; exit; } diff --git a/app/devices/device_vendor_function_edit.php b/app/devices/device_vendor_function_edit.php index 63d382d6a9..06dcd620ef 100644 --- a/app/devices/device_vendor_function_edit.php +++ b/app/devices/device_vendor_function_edit.php @@ -26,6 +26,13 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (!permission_exists('device_vendor_function_add') || !permission_exists('device_vendor_function_edit')) { + echo "access denied"; + exit; + } //add multi-lingual support $language = new text; @@ -34,16 +41,6 @@ //set the defaults $device_vendor_function_uuid = ''; -//check permissions - require_once "resources/check_auth.php"; - if (permission_exists('device_vendor_function_add') || permission_exists('device_vendor_function_edit')) { - //access granted - } - else { - echo "access denied"; - exit; - } - //action add or update if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) { $action = "update"; diff --git a/app/devices/device_vendor_functions.php b/app/devices/device_vendor_functions.php index fe3fb20a1c..4bbdd6011f 100644 --- a/app/devices/device_vendor_functions.php +++ b/app/devices/device_vendor_functions.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('device_vendor_function_view')) { - //access granted - } - else { + if (!permission_exists('device_vendor_function_view')) { echo "access denied"; exit; } diff --git a/app/devices/device_vendor_restore.php b/app/devices/device_vendor_restore.php index f00a160c71..03ab1a0f8b 100644 --- a/app/devices/device_vendor_restore.php +++ b/app/devices/device_vendor_restore.php @@ -27,15 +27,12 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('device_vendor_restore')) { - //access granted - } - else { - echo "access denied"; - exit; + if (!permission_exists('device_vendor_restore')) { + echo "access denied"; + exit; } //add multi-lingual support diff --git a/app/devices/device_vendors.php b/app/devices/device_vendors.php index 3bb5f0a12b..8fc41689b9 100644 --- a/app/devices/device_vendors.php +++ b/app/devices/device_vendors.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('device_vendor_view')) { - //access granted - } - else { + if (!permission_exists('device_vendor_view')) { echo "access denied"; exit; } diff --git a/app/devices/devices.php b/app/devices/devices.php index 9c0f99f197..6c1d930970 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('device_view')) { - //access granted - } - else { + if (!permission_exists('device_view')) { echo "access denied"; exit; } diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index 3bcf1b3eec..7857543b77 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -32,10 +32,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('inbound_route_add')) { - //access granted - } - else { + if (!permission_exists('inbound_route_add')) { echo $text['label-access-denied']; exit; } diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 781ac6fc2b..c22d639749 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -34,10 +34,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('outbound_route_add')) { - //access granted - } - else { + if (!permission_exists('outbound_route_add')) { echo "access denied"; exit; } diff --git a/app/dialplans/dialplan_add.php b/app/dialplans/dialplan_add.php index 0a5988ee1d..9cab363a2a 100644 --- a/app/dialplans/dialplan_add.php +++ b/app/dialplans/dialplan_add.php @@ -29,10 +29,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('dialplan_add')) { - //access granted - } - else { + if (!permission_exists('dialplan_add')) { echo "access denied"; exit; } diff --git a/app/dialplans/dialplan_edit.php b/app/dialplans/dialplan_edit.php index 5020cf5892..651a9a3c9d 100644 --- a/app/dialplans/dialplan_edit.php +++ b/app/dialplans/dialplan_edit.php @@ -31,19 +31,16 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('dialplan_add') - || permission_exists('dialplan_edit') - || permission_exists('inbound_route_add') - || permission_exists('inbound_route_edit') - || permission_exists('outbound_route_add') - || permission_exists('outbound_route_edit') - || permission_exists('fifo_add') - || permission_exists('fifo_edit') - || permission_exists('time_condition_add') - || permission_exists('time_condition_edit')) { - //access granted - } - else { + if (!permission_exists('dialplan_add') + || !permission_exists('dialplan_edit') + || !permission_exists('inbound_route_add') + || !permission_exists('inbound_route_edit') + || !permission_exists('outbound_route_add') + || !permission_exists('outbound_route_edit') + || !permission_exists('fifo_add') + || !permission_exists('fifo_edit') + || !permission_exists('time_condition_add') + || !permission_exists('time_condition_edit')) { echo "access denied"; exit; } diff --git a/app/dialplans/dialplan_xml.php b/app/dialplans/dialplan_xml.php index 7db3264af1..94772393e9 100644 --- a/app/dialplans/dialplan_xml.php +++ b/app/dialplans/dialplan_xml.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('dialplan_edit')) { - //access granted - } - else { + if (!permission_exists('dialplan_edit')) { echo "access denied"; exit; } diff --git a/app/dialplans/dialplans.php b/app/dialplans/dialplans.php index 291a2ff81f..ec9f4fcb95 100644 --- a/app/dialplans/dialplans.php +++ b/app/dialplans/dialplans.php @@ -25,16 +25,13 @@ */ //includes files -global $settings, $domain_uuid, $database; -require_once dirname(__DIR__, 2) . "/resources/require.php"; + global $settings, $domain_uuid, $database; + require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; require_once "resources/paging.php"; //check permissions - if (permission_exists('dialplan_view') || permission_exists('inbound_route_view') || permission_exists('outbound_route_view')) { - //access granted - } - else { + if (!permission_exists('dialplan_view') || !permission_exists('inbound_route_view') || !permission_exists('outbound_route_view')) { echo "access denied"; exit; } diff --git a/app/email_queue/email_queue.php b/app/email_queue/email_queue.php index caa3393e6b..afa13417d4 100644 --- a/app/email_queue/email_queue.php +++ b/app/email_queue/email_queue.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('email_queue_view')) { - //access granted - } - else { + if (!permission_exists('email_queue_view')) { echo "access denied"; exit; } diff --git a/app/email_queue/email_queue_delete.php b/app/email_queue/email_queue_delete.php index 43aaad038e..d61ee187cf 100644 --- a/app/email_queue/email_queue_delete.php +++ b/app/email_queue/email_queue_delete.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('email_queue_delete')) { - //access granted - } - else { + if (!permission_exists('email_queue_delete')) { echo "access denied"; exit; } diff --git a/app/email_queue/email_queue_edit.php b/app/email_queue/email_queue_edit.php index 3b032f5fc1..18dd0d5154 100644 --- a/app/email_queue/email_queue_edit.php +++ b/app/email_queue/email_queue_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('email_queue_add') || permission_exists('email_queue_edit')) { - //access granted - } - else { + if (!permission_exists('email_queue_add') || !permission_exists('email_queue_edit')) { echo "access denied"; exit; } diff --git a/app/email_queue/resources/command/send.php b/app/email_queue/resources/command/send.php index 7a0de3fc32..27ad505974 100644 --- a/app/email_queue/resources/command/send.php +++ b/app/email_queue/resources/command/send.php @@ -82,7 +82,7 @@ } //get the command line parameters - $options = getopt(null, $long_options); + $options = getopt('', $long_options); //set the values from the command line parameters foreach($options as $option_key => $option_value) { diff --git a/app/emergency/emergency.php b/app/emergency/emergency.php index 670a66a01a..130e4a2252 100644 --- a/app/emergency/emergency.php +++ b/app/emergency/emergency.php @@ -6,10 +6,7 @@ require_once "resources/check_auth.php"; require_once "resources/paging.php"; //check permissions -if (permission_exists('emergency_logs_view')) { - //access granted -} -else { +if (!permission_exists('emergency_logs_view')) { echo "access denied"; exit; } @@ -20,9 +17,9 @@ $text = $language->get(); //get the http post data if (!empty($_POST['emergency_logs']) && is_array($_POST['emergency_logs'])) { - $action = $_POST['action']; + $action = $_POST['action'] ?? ''; $search = $_POST['search'] ?? ''; - $emergency_logs = $_POST['emergency_logs']; + $emergency_logs = $_POST['emergency_logs'] ?? ''; } //set permissions for CDR details and call recordings diff --git a/app/event_guard/event_guard_log_edit.php b/app/event_guard/event_guard_log_edit.php index 16e5b71f7e..faecefaafe 100644 --- a/app/event_guard/event_guard_log_edit.php +++ b/app/event_guard/event_guard_log_edit.php @@ -25,10 +25,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('event_guard_log_add') || permission_exists('event_guard_log_edit')) { - //access granted - } - else { + if (!permission_exists('event_guard_log_add') || !permission_exists('event_guard_log_edit')) { echo "access denied"; exit; } diff --git a/app/event_guard/event_guard_logs.php b/app/event_guard/event_guard_logs.php index 69c2d81979..952bdedcbb 100644 --- a/app/event_guard/event_guard_logs.php +++ b/app/event_guard/event_guard_logs.php @@ -29,10 +29,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('event_guard_log_view')) { - //access granted - } - else { + if (!permission_exists('event_guard_log_view')) { echo "access denied"; exit; } diff --git a/app/event_guard/resources/service/event_guard.php b/app/event_guard/resources/service/event_guard.php index 30d100aae6..069e69c5b7 100644 --- a/app/event_guard/resources/service/event_guard.php +++ b/app/event_guard/resources/service/event_guard.php @@ -447,7 +447,7 @@ if ($firewall_name == 'iptables') { $command = $firewall_path.'/./iptables -L '.$filter.' -n --line-numbers | grep "'.$ip_address.' " | cut -d " " -f1'; $line_number = trim(shell($command)); - echo "\n". $command . " line ".__line__." result ".$result."\n"; + echo "\n". $command . " line ".__line__."\n"; if (is_numeric($line_number)) { //$result = shell('iptables -D INPUT '.$line_number); $command = $firewall_path.'/./iptables -D '.$filter.' '.$line_number; diff --git a/app/extension_settings/extension_setting_edit.php b/app/extension_settings/extension_setting_edit.php index 264f22a090..36677e54ba 100644 --- a/app/extension_settings/extension_setting_edit.php +++ b/app/extension_settings/extension_setting_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('extension_setting_add') || permission_exists('extension_setting_edit')) { - //access granted - } - else { + if (!permission_exists('extension_setting_add') || !permission_exists('extension_setting_edit')) { echo "access denied"; exit; } diff --git a/app/extension_settings/extension_settings.php b/app/extension_settings/extension_settings.php index af79e29322..e2d756ab7e 100644 --- a/app/extension_settings/extension_settings.php +++ b/app/extension_settings/extension_settings.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('extension_setting_view')) { - //access granted - } - else { + if (!permission_exists('extension_setting_view')) { echo "access denied"; exit; } diff --git a/app/extension_settings/resources/classes/extension_settings.php b/app/extension_settings/resources/classes/extension_settings.php index cb6423c609..7892257e75 100644 --- a/app/extension_settings/resources/classes/extension_settings.php +++ b/app/extension_settings/resources/classes/extension_settings.php @@ -35,6 +35,11 @@ const app_name = 'extension_settings'; const app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; + /** + * declare the public variables + */ + public $extension_uuid; + /** * Set in the constructor. Must be a database object and cannot be null. * @var database Database Object @@ -60,7 +65,7 @@ private $domain_uuid; /** - * declare the variables + * declare the private variables */ private $name; private $table; @@ -68,7 +73,6 @@ private $toggle_values; private $description_field; private $location; - private $extension_uuid; /** * called when the object is created diff --git a/app/extensions/extension_copy.php b/app/extensions/extension_copy.php index af8127ff6f..16bbf880a3 100644 --- a/app/extensions/extension_copy.php +++ b/app/extensions/extension_copy.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('extension_copy')) { - //access granted - } - else { + if (!permission_exists('extension_copy')) { echo "access denied"; exit; } diff --git a/app/extensions/extension_download.php b/app/extensions/extension_download.php index 19182ebdc9..9132144d47 100644 --- a/app/extensions/extension_download.php +++ b/app/extensions/extension_download.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('extension_export')) { - //access granted - } - else { + if (!permission_exists('extension_export')) { echo "access denied"; exit; } diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index cba0a37e3f..58221553b9 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('extension_add') || permission_exists('extension_edit')) { - //access granted - } - else { + if (!permission_exists('extension_add') || !permission_exists('extension_edit')) { echo "access denied"; exit; } diff --git a/app/extensions/extension_imports.php b/app/extensions/extension_imports.php index 94a41e4523..837dba6550 100644 --- a/app/extensions/extension_imports.php +++ b/app/extensions/extension_imports.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('extension_import')) { - //access granted - } - else { + if (!permission_exists('extension_import')) { echo "access denied"; exit; } diff --git a/app/extensions/extensions.php b/app/extensions/extensions.php index f5e36269b6..71fb4c7876 100644 --- a/app/extensions/extensions.php +++ b/app/extensions/extensions.php @@ -31,10 +31,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('extension_view')) { - //access granted - } - else { + if (!permission_exists('extension_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax.php b/app/fax/fax.php index 932bb071f0..1ce89cf931 100644 --- a/app/fax/fax.php +++ b/app/fax/fax.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fax_extension_view')) { - //access granted - } - else { + if (!permission_exists('fax_extension_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_advanced.php b/app/fax/fax_advanced.php index a89808739c..a86715fc46 100644 --- a/app/fax/fax_advanced.php +++ b/app/fax/fax_advanced.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('fax_extension_advanced')) { - //access granted - } - else { + if (!permission_exists('fax_extension_advanced')) { echo "access denied"; exit; } diff --git a/app/fax/fax_copy.php b/app/fax/fax_copy.php index 88386e60c3..f7992f6f33 100644 --- a/app/fax/fax_copy.php +++ b/app/fax/fax_copy.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fax_extension_copy')) { - //access granted - } - else { + if (!permission_exists('fax_extension_copy')) { echo "access denied"; exit; } diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 4a6f59b75e..2faa099b01 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('fax_extension_add') || permission_exists('fax_extension_edit') || permission_exists('fax_extension_delete')) { - //access granted - } - else { + if (!permission_exists('fax_extension_add') || !permission_exists('fax_extension_edit') || !permission_exists('fax_extension_delete')) { echo "access denied"; exit; } diff --git a/app/fax/fax_files.php b/app/fax/fax_files.php index 09efe92a37..660b54efcc 100644 --- a/app/fax/fax_files.php +++ b/app/fax/fax_files.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fax_file_view')) { - //access granted - } - else { + if (!permission_exists('fax_file_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_files_remote.php b/app/fax/fax_files_remote.php index 3ed361ab53..9f429afbcf 100644 --- a/app/fax/fax_files_remote.php +++ b/app/fax/fax_files_remote.php @@ -32,10 +32,7 @@ require_once "resources/functions/parse_message.php"; //check permissions - if (permission_exists('fax_inbox_view')) { - //access granted - } - else { + if (!permission_exists('fax_inbox_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_log_view.php b/app/fax/fax_log_view.php index 63e625564d..47aca61f95 100644 --- a/app/fax/fax_log_view.php +++ b/app/fax/fax_log_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('fax_log_view')) { - //access granted - } - else { + if (!permission_exists('fax_log_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_logs.php b/app/fax/fax_logs.php index 6a84386803..f77c48afe7 100644 --- a/app/fax/fax_logs.php +++ b/app/fax/fax_logs.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fax_log_view')) { - //access granted - } - else { + if (!permission_exists('fax_log_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_outbox.php b/app/fax/fax_outbox.php index 9dd42ca789..5786e60c59 100644 --- a/app/fax/fax_outbox.php +++ b/app/fax/fax_outbox.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fax_extension_view')) { - //access granted - } - else { + if (!permission_exists('fax_extension_view')) { echo "access denied"; exit; } diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index ea6fbfa9ca..0260f0ddc7 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -49,19 +49,18 @@ //additional include require_once "resources/check_auth.php"; + //check permissions + if (!permission_exists('fax_send')) { + echo "access denied"; + exit; + } + //set the domain_uuid and domain_name $domain_uuid = $_SESSION['domain_uuid']; $domain_name = $_SESSION['domain_name']; $user_uuid = $_SESSION['user_uuid']; - //check permissions - if (permission_exists('fax_send')) { - //access granted - } - else { - echo "access denied"; - exit; - } + //add multi-lingual support $language = new text; diff --git a/app/fax_queue/fax_queue.php b/app/fax_queue/fax_queue.php index 8f51da6196..6a0549d23c 100644 --- a/app/fax_queue/fax_queue.php +++ b/app/fax_queue/fax_queue.php @@ -27,10 +27,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fax_queue_view')) { - //access granted - } - else { + if (!permission_exists('fax_queue_view')) { echo "access denied"; exit; } diff --git a/app/fax_queue/fax_queue_delete.php b/app/fax_queue/fax_queue_delete.php index 2c8bf6b5e0..074294a9c8 100644 --- a/app/fax_queue/fax_queue_delete.php +++ b/app/fax_queue/fax_queue_delete.php @@ -5,10 +5,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('fax_queue_delete')) { - //access granted - } - else { + if (!permission_exists('fax_queue_delete')) { echo "access denied"; exit; } diff --git a/app/fax_queue/fax_queue_edit.php b/app/fax_queue/fax_queue_edit.php index f186466eef..55c9248070 100644 --- a/app/fax_queue/fax_queue_edit.php +++ b/app/fax_queue/fax_queue_edit.php @@ -27,10 +27,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('fax_queue_add') || permission_exists('fax_queue_edit')) { - //access granted - } - else { + if (!permission_exists('fax_queue_add') || !permission_exists('fax_queue_edit')) { echo "access denied"; exit; } diff --git a/app/fifo/fifo.php b/app/fifo/fifo.php index 8a1cfabb8d..6e41a2de78 100644 --- a/app/fifo/fifo.php +++ b/app/fifo/fifo.php @@ -27,10 +27,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('fifo_view')) { - //access granted - } - else { + if (!permission_exists('fifo_view')) { echo "access denied"; exit; } diff --git a/app/fifo/fifo_edit.php b/app/fifo/fifo_edit.php index af08c45a82..ba07af0827 100644 --- a/app/fifo/fifo_edit.php +++ b/app/fifo/fifo_edit.php @@ -27,10 +27,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('fifo_add') || permission_exists('fifo_edit')) { - //access granted - } - else { + if (!permission_exists('fifo_add') || !permission_exists('fifo_edit')) { echo "access denied"; exit; } diff --git a/app/fifo_list/fifo_exec.php b/app/fifo_list/fifo_exec.php index 24cacc1aec..ab60be4732 100644 --- a/app/fifo_list/fifo_exec.php +++ b/app/fifo_list/fifo_exec.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('active_queue_edit')) { - //access granted - } - else { + if (!permission_exists('active_queue_edit')) { echo "access denied"; exit; } diff --git a/app/fifo_list/fifo_interactive.php b/app/fifo_list/fifo_interactive.php index 9cb4feb60b..311da79269 100644 --- a/app/fifo_list/fifo_interactive.php +++ b/app/fifo_list/fifo_interactive.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('active_queue_view')) { - //access granted - } - else { + if (!permission_exists('active_queue_view')) { echo "access denied"; exit; } diff --git a/app/fifo_list/fifo_interactive_inc.php b/app/fifo_list/fifo_interactive_inc.php index 4957ecf2e1..788f925fef 100644 --- a/app/fifo_list/fifo_interactive_inc.php +++ b/app/fifo_list/fifo_interactive_inc.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('active_queue_view')) { - //access granted - } - else { + if (!permission_exists('active_queue_view')) { echo "access denied"; exit; } diff --git a/app/fifo_list/fifo_list.php b/app/fifo_list/fifo_list.php index ec236ec0ff..44a6df7823 100644 --- a/app/fifo_list/fifo_list.php +++ b/app/fifo_list/fifo_list.php @@ -28,10 +28,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('active_queue_view')) { - //access granted - } - else { + if (!permission_exists('active_queue_view')) { echo "access denied"; exit; } diff --git a/app/fifo_list/fifo_list_inc.php b/app/fifo_list/fifo_list_inc.php index fcce1f61e4..22353ec561 100644 --- a/app/fifo_list/fifo_list_inc.php +++ b/app/fifo_list/fifo_list_inc.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('active_queue_view')) { - //access granted - } - else { + if (!permission_exists('active_queue_view')) { echo "access denied"; exit; } diff --git a/app/gateways/gateway_copy.php b/app/gateways/gateway_copy.php index dd617d3f47..9eb8834e11 100644 --- a/app/gateways/gateway_copy.php +++ b/app/gateways/gateway_copy.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('gateway_add')) { - //access granted - } - else { + if (!permission_exists('gateway_add')) { echo "access denied"; exit; } diff --git a/app/gateways/gateway_edit.php b/app/gateways/gateway_edit.php index 36567b8a90..68551fbad8 100644 --- a/app/gateways/gateway_edit.php +++ b/app/gateways/gateway_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('gateway_add') || permission_exists('gateway_edit')) { - //access granted - } - else { + if (!permission_exists('gateway_add') || !permission_exists('gateway_edit')) { echo "access denied"; exit; } diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php index 56466766f6..23dc00fade 100644 --- a/app/gateways/gateways.php +++ b/app/gateways/gateways.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('gateway_view')) { - //access granted - } - else { + if (!permission_exists('gateway_view')) { echo "access denied"; exit; } diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index c731af0bf7..1bb2419872 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('ivr_menu_add') || permission_exists('ivr_menu_edit')) { - //access granted - } - else { + if (!permission_exists('ivr_menu_add') || !permission_exists('ivr_menu_edit')) { echo "access denied"; exit; } diff --git a/app/ivr_menus/ivr_menus.php b/app/ivr_menus/ivr_menus.php index 539992c118..c41c512f21 100644 --- a/app/ivr_menus/ivr_menus.php +++ b/app/ivr_menus/ivr_menus.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('ivr_menu_view')) { - //access granted - } - else { + if (!permission_exists('ivr_menu_view')) { echo "access denied"; exit; } diff --git a/app/log_viewer/log_viewer.php b/app/log_viewer/log_viewer.php index 7541aa9b4f..63ff77c67d 100644 --- a/app/log_viewer/log_viewer.php +++ b/app/log_viewer/log_viewer.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('log_view')) { - //access granted - } - else { + if (!permission_exists('log_view')) { echo "access denied"; exit; } diff --git a/app/modules/module_edit.php b/app/modules/module_edit.php index 202c29210f..670eb1e780 100644 --- a/app/modules/module_edit.php +++ b/app/modules/module_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('module_add') || permission_exists('module_edit')) { - //access granted - } - else { + if (!permission_exists('module_add') || !permission_exists('module_edit')) { echo "access denied"; exit; } diff --git a/app/modules/modules.php b/app/modules/modules.php index f29d760cdb..d0b32fd872 100644 --- a/app/modules/modules.php +++ b/app/modules/modules.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('module_view')) { - //access granted - } - else { + if (!permission_exists('module_view')) { echo "access denied"; exit; } diff --git a/app/music_on_hold/music_on_hold.php b/app/music_on_hold/music_on_hold.php index 5c83bd169f..91a91478ad 100644 --- a/app/music_on_hold/music_on_hold.php +++ b/app/music_on_hold/music_on_hold.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('music_on_hold_view')) { - //access granted - } - else { + if (!permission_exists('music_on_hold_view')) { echo "access denied"; exit; } diff --git a/app/music_on_hold/music_on_hold_edit.php b/app/music_on_hold/music_on_hold_edit.php index 4fc5f37db6..0c7c0ba193 100644 --- a/app/music_on_hold/music_on_hold_edit.php +++ b/app/music_on_hold/music_on_hold_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('music_on_hold_add') || permission_exists('music_on_hold_edit')) { - //access granted - } - else { + if (!permission_exists('music_on_hold_add') || !permission_exists('music_on_hold_edit')) { echo "access denied"; exit; } diff --git a/app/number_translations/cmd.php b/app/number_translations/cmd.php index 26a65cc665..ef2f46759f 100644 --- a/app/number_translations/cmd.php +++ b/app/number_translations/cmd.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('number_translation_add') || permission_exists('number_translation_edit')) { - //access granted - } - else { + if (!permission_exists('number_translation_add') || !permission_exists('number_translation_edit')) { echo "access denied"; exit; } diff --git a/app/number_translations/number_translation_edit.php b/app/number_translations/number_translation_edit.php index b4696bfd9a..62bf64bc7d 100644 --- a/app/number_translations/number_translation_edit.php +++ b/app/number_translations/number_translation_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('number_translation_add') || permission_exists('number_translation_edit')) { - //access granted - } - else { + if (!permission_exists('number_translation_add') || !permission_exists('number_translation_edit')) { echo "access denied"; exit; } diff --git a/app/number_translations/number_translations.php b/app/number_translations/number_translations.php index 33e9ac39be..c8f1c72a30 100644 --- a/app/number_translations/number_translations.php +++ b/app/number_translations/number_translations.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('number_translation_view')) { - //access granted - } - else { + if (!permission_exists('number_translation_view')) { echo "access denied"; exit; } diff --git a/app/pin_numbers/pin_number_edit.php b/app/pin_numbers/pin_number_edit.php index e58d7999bc..628dbfccd8 100644 --- a/app/pin_numbers/pin_number_edit.php +++ b/app/pin_numbers/pin_number_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('pin_number_add') || permission_exists('pin_number_edit')) { - //access granted - } - else { + if (!permission_exists('pin_number_add') || !permission_exists('pin_number_edit')) { echo "access denied"; exit; } diff --git a/app/pin_numbers/pin_numbers.php b/app/pin_numbers/pin_numbers.php index eab968178b..c91c4bda31 100644 --- a/app/pin_numbers/pin_numbers.php +++ b/app/pin_numbers/pin_numbers.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('pin_number_view')) { - //access granted - } - else { + if (!permission_exists('pin_number_view')) { echo "access denied"; exit; } diff --git a/app/recordings/recording_edit.php b/app/recordings/recording_edit.php index 3abd874812..793de49ffc 100644 --- a/app/recordings/recording_edit.php +++ b/app/recordings/recording_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('recording_add') || permission_exists('recording_edit')) { - //access granted - } - else { + if (!permission_exists('recording_add') || !permission_exists('recording_edit')) { echo "access denied"; exit; } diff --git a/app/recordings/recordings.php b/app/recordings/recordings.php index 4f20cc8bf6..6f70b7fbc2 100644 --- a/app/recordings/recordings.php +++ b/app/recordings/recordings.php @@ -173,10 +173,7 @@ } //check the permission - if (permission_exists('recording_view')) { - //access granted - } - else { + if (!permission_exists('recording_view')) { echo "access denied"; exit; } diff --git a/app/registrations/registration_reload.php b/app/registrations/registration_reload.php index f6c23ba148..95314c4b65 100644 --- a/app/registrations/registration_reload.php +++ b/app/registrations/registration_reload.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists("registration_reload")) { - //access granted - } - else { + if (!permission_exists("registration_reload")) { echo "access denied"; exit; } diff --git a/app/registrations/registrations.php b/app/registrations/registrations.php index 804f37d93d..02efc22aa0 100644 --- a/app/registrations/registrations.php +++ b/app/registrations/registrations.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists("registration_domain") || permission_exists("registration_all") || if_group("superadmin")) { - //access granted - } - else { + if (!permission_exists("registration_domain") || !permission_exists("registration_all")) { echo "access denied"; exit; } diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index 035725f065..71cca7cc59 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -31,10 +31,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { - //access granted - } - else { + if (!permission_exists('ring_group_add') || !permission_exists('ring_group_edit')) { echo "access denied"; exit; } diff --git a/app/ring_groups/ring_groups.php b/app/ring_groups/ring_groups.php index adb85dcd43..b1c47036a6 100644 --- a/app/ring_groups/ring_groups.php +++ b/app/ring_groups/ring_groups.php @@ -31,10 +31,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('ring_group_view')) { - //access granted - } - else { + if (!permission_exists('ring_group_view')) { echo "access denied"; exit; } diff --git a/app/sip_profiles/sip_profile_copy.php b/app/sip_profiles/sip_profile_copy.php index b96e1951c7..dc585c5888 100644 --- a/app/sip_profiles/sip_profile_copy.php +++ b/app/sip_profiles/sip_profile_copy.php @@ -30,13 +30,11 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('dialplan_add') - || permission_exists('inbound_route_add') - || permission_exists('outbound_route_add') - || permission_exists('time_condition_add')) { + if (!permission_exists('dialplan_add') + || !permission_exists('inbound_route_add') + || !permission_exists('outbound_route_add') + || !permission_exists('time_condition_add')) { //access granted - } - else { echo "access denied"; exit; } diff --git a/app/sip_profiles/sip_profile_edit.php b/app/sip_profiles/sip_profile_edit.php index f2cb7ac34f..825f08b5ac 100644 --- a/app/sip_profiles/sip_profile_edit.php +++ b/app/sip_profiles/sip_profile_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('sip_profile_add') || permission_exists('sip_profile_edit')) { - //access granted - } - else { + if (!permission_exists('sip_profile_add') || !permission_exists('sip_profile_edit')) { echo "access denied"; exit; } diff --git a/app/sip_profiles/sip_profiles.php b/app/sip_profiles/sip_profiles.php index cc70dc33e4..66ac634281 100644 --- a/app/sip_profiles/sip_profiles.php +++ b/app/sip_profiles/sip_profiles.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('sip_profile_view')) { - //access granted - } - else { + if (!permission_exists('sip_profile_view')) { echo "access denied"; exit; } diff --git a/app/sip_status/cmd.php b/app/sip_status/cmd.php index d43f500300..102e6cab0b 100644 --- a/app/sip_status/cmd.php +++ b/app/sip_status/cmd.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists("sip_status_command")) { - //access granted - } - else { + if (!permission_exists("sip_status_command")) { echo "access denied"; exit; } diff --git a/app/sip_status/sip_status.php b/app/sip_status/sip_status.php index 648ee44d04..b396935e8d 100644 --- a/app/sip_status/sip_status.php +++ b/app/sip_status/sip_status.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('system_status_sofia_status') || permission_exists('system_status_sofia_status_profile') || if_group("superadmin")) { - //access granted - } - else { + if (!permission_exists('system_status_sofia_status') || !permission_exists('system_status_sofia_status_profile')) { echo "access denied"; exit; } diff --git a/app/sofia_global_settings/sofia_global_setting_edit.php b/app/sofia_global_settings/sofia_global_setting_edit.php index 1152521a6a..14795180bc 100644 --- a/app/sofia_global_settings/sofia_global_setting_edit.php +++ b/app/sofia_global_settings/sofia_global_setting_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('sofia_global_setting_add') || permission_exists('sofia_global_setting_edit')) { - //access granted - } - else { + if (!permission_exists('sofia_global_setting_add') || !permission_exists('sofia_global_setting_edit')) { echo "access denied"; exit; } diff --git a/app/sofia_global_settings/sofia_global_settings.php b/app/sofia_global_settings/sofia_global_settings.php index 6ee351a7cb..5b4a7749a2 100644 --- a/app/sofia_global_settings/sofia_global_settings.php +++ b/app/sofia_global_settings/sofia_global_settings.php @@ -27,10 +27,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('sofia_global_setting_view')) { - //access granted - } - else { + if (!permission_exists('sofia_global_setting_view')) { echo "access denied"; exit; } diff --git a/app/streams/stream_edit.php b/app/streams/stream_edit.php index 58bcab2296..0a9f67d630 100644 --- a/app/streams/stream_edit.php +++ b/app/streams/stream_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('stream_add') || permission_exists('stream_edit')) { - //access granted - } - else { + if (!permission_exists('stream_add') || !permission_exists('stream_edit')) { echo "access denied"; exit; } diff --git a/app/streams/streams.php b/app/streams/streams.php index f07ac7c751..96238d3ab1 100644 --- a/app/streams/streams.php +++ b/app/streams/streams.php @@ -27,10 +27,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('stream_view')) { - //access granted - } - else { + if (!permission_exists('stream_view')) { echo "access denied"; exit; } diff --git a/app/switch/sounds.php b/app/switch/sounds.php index c3f27ae3bd..755ce5c7e9 100644 --- a/app/switch/sounds.php +++ b/app/switch/sounds.php @@ -32,10 +32,7 @@ require_once "resources/check_auth.php"; //check the permission - if (permission_exists('recording_play') || permission_exists('recording_download')) { - //access granted - } - else { + if (!permission_exists('recording_play') || !permission_exists('recording_download')) { echo "access denied"; exit; } diff --git a/app/system/resources/dashboard/system_services.php b/app/system/resources/dashboard/system_services.php index 8dd860d51d..a99d41fbfc 100644 --- a/app/system/resources/dashboard/system_services.php +++ b/app/system/resources/dashboard/system_services.php @@ -28,13 +28,10 @@ //includes files require_once dirname(__DIR__, 4) . "/resources/require.php"; + require_once "resources/check_auth.php"; //check permissions - require_once "resources/check_auth.php"; - if (permission_exists('xml_cdr_view')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_view')) { echo "access denied"; exit; } diff --git a/app/system/system.php b/app/system/system.php index fb34ddd0ff..494aa1a127 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -29,14 +29,11 @@ Con Portions created by the Initial Developer are Copyright (C) 2008-2025 require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions - if (permission_exists('system_view_info') - || permission_exists('system_view_cpu') - || permission_exists('system_view_hdd') - || permission_exists('system_view_ram') - || permission_exists('system_view_backup')) { - //access granted - } - else { + if (!permission_exists('system_view_info') + || !permission_exists('system_view_cpu') + || !permission_exists('system_view_hdd') + || !permission_exists('system_view_ram') + || !permission_exists('system_view_backup')) { echo "access denied"; exit; } diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index e19d2f9e97..d515b28808 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('time_condition_add') || permission_exists('time_condition_edit')) { - //access granted - } - else { + if (!permission_exists('time_condition_add') || !permission_exists('time_condition_edit')) { echo "access denied"; exit; } diff --git a/app/time_conditions/time_conditions.php b/app/time_conditions/time_conditions.php index 982119d6dc..8276144c2a 100644 --- a/app/time_conditions/time_conditions.php +++ b/app/time_conditions/time_conditions.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('time_condition_view')) { - //access granted - } - else { + if (!permission_exists('time_condition_view')) { echo "access denied"; exit; } diff --git a/app/vars/var_edit.php b/app/vars/var_edit.php index cac05c8900..4ee2dd246c 100644 --- a/app/vars/var_edit.php +++ b/app/vars/var_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('var_add') || permission_exists('var_edit')) { - //access granted - } - else { + if (!permission_exists('var_add') || !permission_exists('var_edit')) { echo "access denied"; exit; } diff --git a/app/vars/vars.php b/app/vars/vars.php index 11bf09091b..25dfc93ffc 100644 --- a/app/vars/vars.php +++ b/app/vars/vars.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('var_view')) { - //access granted - } - else { + if (!permission_exists('var_view')) { echo "access denied"; exit; } diff --git a/app/voicemail_greetings/voicemail_greeting_edit.php b/app/voicemail_greetings/voicemail_greeting_edit.php index 89ac2faa73..fd8fe80766 100644 --- a/app/voicemail_greetings/voicemail_greeting_edit.php +++ b/app/voicemail_greetings/voicemail_greeting_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('voicemail_greeting_edit')) { - //access granted - } - else { + if (!permission_exists('voicemail_greeting_edit')) { echo "access denied"; exit; } diff --git a/app/voicemail_greetings/voicemail_greetings.php b/app/voicemail_greetings/voicemail_greetings.php index 5fa2cbbb68..1534eadfc8 100644 --- a/app/voicemail_greetings/voicemail_greetings.php +++ b/app/voicemail_greetings/voicemail_greetings.php @@ -239,10 +239,7 @@ } //check the permission - if (permission_exists('voicemail_greeting_view')) { - //access granted - } - else { + if (!permission_exists('voicemail_greeting_view')) { echo "access denied"; exit; } diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index d339d2b499..118aaf1693 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('voicemail_add') || permission_exists('voicemail_edit')) { - //access granted - } - else { + if (!permission_exists('voicemail_add') || !permission_exists('voicemail_edit')) { echo "access denied"; exit; } diff --git a/app/voicemails/voicemail_export.php b/app/voicemails/voicemail_export.php index bbbf662a9f..db0af73f1a 100644 --- a/app/voicemails/voicemail_export.php +++ b/app/voicemails/voicemail_export.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('voicemail_export')) { - //access granted - } - else { + if (!permission_exists('voicemail_export')) { echo "access denied"; exit; } diff --git a/app/voicemails/voicemail_imports.php b/app/voicemails/voicemail_imports.php index 5730c997c2..f8c8a28898 100644 --- a/app/voicemails/voicemail_imports.php +++ b/app/voicemails/voicemail_imports.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('voicemail_import')) { - //access granted - } - else { + if (!permission_exists('voicemail_import')) { echo "access denied"; exit; } diff --git a/app/voicemails/voicemail_message_toggle.php b/app/voicemails/voicemail_message_toggle.php index da1afc7c0c..1998817ca3 100644 --- a/app/voicemails/voicemail_message_toggle.php +++ b/app/voicemails/voicemail_message_toggle.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('voicemail_message_view')) { - //access granted - } - else { + if (!permission_exists('voicemail_message_view')) { echo "access denied"; exit; } diff --git a/app/voicemails/voicemail_messages.php b/app/voicemails/voicemail_messages.php index 24d6c30704..a987bba7f8 100644 --- a/app/voicemails/voicemail_messages.php +++ b/app/voicemails/voicemail_messages.php @@ -83,10 +83,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('voicemail_message_view')) { - //access granted - } - else { + if (!permission_exists('voicemail_message_view')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/report.php b/app/xml_cdr/report.php index 1b2ea70a69..82d10a896f 100644 --- a/app/xml_cdr/report.php +++ b/app/xml_cdr/report.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('xml_cdr_view')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_view')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index 259fa0b5d9..bd19213811 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('xml_cdr_details')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_details')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_export.php b/app/xml_cdr/xml_cdr_export.php index 5070c9e4c2..37063501b9 100644 --- a/app/xml_cdr/xml_cdr_export.php +++ b/app/xml_cdr/xml_cdr_export.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('xml_cdr_export')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_export')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index a8c3351622..387033d53c 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -31,10 +31,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('xml_cdr_view')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_view')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_log.php b/app/xml_cdr/xml_cdr_log.php index 8dd71f9262..78e4744c19 100644 --- a/app/xml_cdr/xml_cdr_log.php +++ b/app/xml_cdr/xml_cdr_log.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('log_view')) { - //access granted - } - else { + if (!permission_exists('log_view')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_search.php b/app/xml_cdr/xml_cdr_search.php index 9ab289f08c..51c97187cb 100644 --- a/app/xml_cdr/xml_cdr_search.php +++ b/app/xml_cdr/xml_cdr_search.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('xml_cdr_search_advanced')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_search_advanced')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_statistics.php b/app/xml_cdr/xml_cdr_statistics.php index 1e45aa5a28..a1439ee9c5 100644 --- a/app/xml_cdr/xml_cdr_statistics.php +++ b/app/xml_cdr/xml_cdr_statistics.php @@ -30,10 +30,7 @@ require_once "xml_cdr_statistics_inc.php"; //check permissions - if (permission_exists('xml_cdr_statistics')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_statistics')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_statistics_csv.php b/app/xml_cdr/xml_cdr_statistics_csv.php index da2ba1e09f..7722f5b8b8 100644 --- a/app/xml_cdr/xml_cdr_statistics_csv.php +++ b/app/xml_cdr/xml_cdr_statistics_csv.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('xml_cdr_statistics')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_statistics')) { echo "access denied"; exit; } diff --git a/app/xml_cdr/xml_cdr_statistics_inc.php b/app/xml_cdr/xml_cdr_statistics_inc.php index c083e77a28..5d3809715a 100644 --- a/app/xml_cdr/xml_cdr_statistics_inc.php +++ b/app/xml_cdr/xml_cdr_statistics_inc.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('xml_cdr_statistics')) { - //access granted - } - else { + if (!permission_exists('xml_cdr_statistics')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_address_edit.php b/core/contacts/contact_address_edit.php index b370bb1ec1..92a21056b3 100644 --- a/core/contacts/contact_address_edit.php +++ b/core/contacts/contact_address_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_address_edit') || permission_exists('contact_address_add')) { - //access granted - } - else { + if (!permission_exists('contact_address_edit') || !permission_exists('contact_address_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_addresses.php b/core/contacts/contact_addresses.php index 3d3d0c593f..7cb1b8ffec 100644 --- a/core/contacts/contact_addresses.php +++ b/core/contacts/contact_addresses.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_address_view')) { - //access granted - } - else { + if (!permission_exists('contact_address_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_addresses_view.php b/core/contacts/contact_addresses_view.php index 365a81484e..c1b4acd400 100644 --- a/core/contacts/contact_addresses_view.php +++ b/core/contacts/contact_addresses_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_address_view')) { - //access granted - } - else { + if (!permission_exists('contact_address_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_attachments.php b/core/contacts/contact_attachments.php index 4d5dc4b837..ba13c5f5c5 100644 --- a/core/contacts/contact_attachments.php +++ b/core/contacts/contact_attachments.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_attachment_view')) { - //access granted - } - else { + if (!permission_exists('contact_attachment_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_attachments_view.php b/core/contacts/contact_attachments_view.php index fe376bc26f..5947578001 100644 --- a/core/contacts/contact_attachments_view.php +++ b/core/contacts/contact_attachments_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_attachment_view')) { - //access granted - } - else { + if (!permission_exists('contact_attachment_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_edit.php b/core/contacts/contact_edit.php index da7a143bcf..553eaba25b 100644 --- a/core/contacts/contact_edit.php +++ b/core/contacts/contact_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_add') || permission_exists('contact_edit')) { - //access granted - } - else { + if (!permission_exists('contact_add') || !permission_exists('contact_edit')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_email_edit.php b/core/contacts/contact_email_edit.php index 0eff7600e0..e7f7375016 100644 --- a/core/contacts/contact_email_edit.php +++ b/core/contacts/contact_email_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_email_edit') || permission_exists('contact_email_add')) { - //access granted - } - else { + if (!permission_exists('contact_email_edit') || !permission_exists('contact_email_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_emails.php b/core/contacts/contact_emails.php index f9994cdc0a..02f7be8c30 100644 --- a/core/contacts/contact_emails.php +++ b/core/contacts/contact_emails.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_email_view')) { - //access granted - } - else { + if (!permission_exists('contact_email_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_emails_view.php b/core/contacts/contact_emails_view.php index edb5076ac8..8f8e691a9a 100644 --- a/core/contacts/contact_emails_view.php +++ b/core/contacts/contact_emails_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_email_view')) { - //access granted - } - else { + if (!permission_exists('contact_email_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_extensions.php b/core/contacts/contact_extensions.php index c9bf974706..bcb35cbc70 100644 --- a/core/contacts/contact_extensions.php +++ b/core/contacts/contact_extensions.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_extension_view')) { - //access granted - } - else { + if (!permission_exists('contact_extension_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_extensions_view.php b/core/contacts/contact_extensions_view.php index 8fe47a4adb..c0e92693ee 100644 --- a/core/contacts/contact_extensions_view.php +++ b/core/contacts/contact_extensions_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_extension_view')) { - //access granted - } - else { + if (!permission_exists('contact_extension_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_import.php b/core/contacts/contact_import.php index cace77a2a5..c9e9d7cb9d 100644 --- a/core/contacts/contact_import.php +++ b/core/contacts/contact_import.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_add')) { - //access granted - } - else { + if (!permission_exists('contact_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_import_google.php b/core/contacts/contact_import_google.php index b8264702f8..90cf218237 100644 --- a/core/contacts/contact_import_google.php +++ b/core/contacts/contact_import_google.php @@ -31,10 +31,7 @@ require_once "resources/functions/google_get_contacts.php"; //check permissions - if (permission_exists('contact_add')) { - //access granted - } - else { + if (!permission_exists('contact_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_json.php b/core/contacts/contact_json.php index dabaf5c450..2f60da8f08 100644 --- a/core/contacts/contact_json.php +++ b/core/contacts/contact_json.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_view')) { - //access granted - } - else { + if (!permission_exists('contact_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_note_edit.php b/core/contacts/contact_note_edit.php index 4f23886b17..76ad16f2a8 100644 --- a/core/contacts/contact_note_edit.php +++ b/core/contacts/contact_note_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_note_edit') || permission_exists('contact_note_add')) { - //access granted - } - else { + if (!permission_exists('contact_note_edit') || !permission_exists('contact_note_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_notes.php b/core/contacts/contact_notes.php index 47b323d0b0..a9db5579e2 100644 --- a/core/contacts/contact_notes.php +++ b/core/contacts/contact_notes.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_note_view')) { - //access granted - } - else { + if (!permission_exists('contact_note_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_notes_view.php b/core/contacts/contact_notes_view.php index 3e2d64847b..646f2b93c1 100644 --- a/core/contacts/contact_notes_view.php +++ b/core/contacts/contact_notes_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_note_view')) { - //access granted - } - else { + if (!permission_exists('contact_note_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_phone_edit.php b/core/contacts/contact_phone_edit.php index e083b9f50f..fb4e29e0b1 100644 --- a/core/contacts/contact_phone_edit.php +++ b/core/contacts/contact_phone_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_phone_edit') || permission_exists('contact_phone_add')) { - //access granted - } - else { + if (!permission_exists('contact_phone_edit') || !permission_exists('contact_phone_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_phones.php b/core/contacts/contact_phones.php index 838553ea8b..a5f4107ce7 100644 --- a/core/contacts/contact_phones.php +++ b/core/contacts/contact_phones.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_phone_view')) { - //access granted - } - else { + if (!permission_exists('contact_phone_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_phones_view.php b/core/contacts/contact_phones_view.php index 265ab9473b..3a103e83ba 100644 --- a/core/contacts/contact_phones_view.php +++ b/core/contacts/contact_phones_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_phone_view')) { - //access granted - } - else { + if (!permission_exists('contact_phone_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_relation_edit.php b/core/contacts/contact_relation_edit.php index 8c7c875a45..f9afe03b28 100644 --- a/core/contacts/contact_relation_edit.php +++ b/core/contacts/contact_relation_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_relation_edit') || permission_exists('contact_relation_add')) { - //access granted - } - else { + if (!permission_exists('contact_relation_edit') || !permission_exists('contact_relation_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_relations.php b/core/contacts/contact_relations.php index 28cd9914d3..b5101deb50 100644 --- a/core/contacts/contact_relations.php +++ b/core/contacts/contact_relations.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_relation_view')) { - //access granted - } - else { + if (!permission_exists('contact_relation_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_setting_edit.php b/core/contacts/contact_setting_edit.php index c48ba79423..69f2c0428d 100644 --- a/core/contacts/contact_setting_edit.php +++ b/core/contacts/contact_setting_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_setting_edit') || permission_exists('contact_setting_add')) { - //access granted - } - else { + if (!permission_exists('contact_setting_edit') || !permission_exists('contact_setting_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_settings.php b/core/contacts/contact_settings.php index 8ba5429384..565a665af7 100644 --- a/core/contacts/contact_settings.php +++ b/core/contacts/contact_settings.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_setting_view')) { - //access granted - } - else { + if (!permission_exists('contact_setting_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_time_edit.php b/core/contacts/contact_time_edit.php index 1168e2a3f9..8988e34c30 100644 --- a/core/contacts/contact_time_edit.php +++ b/core/contacts/contact_time_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_time_edit') || permission_exists('contact_time_add')) { - //access granted - } - else { + if (!permission_exists('contact_time_edit') || !permission_exists('contact_time_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_times.php b/core/contacts/contact_times.php index 94d1b6731a..1577e029aa 100644 --- a/core/contacts/contact_times.php +++ b/core/contacts/contact_times.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_time_view')) { - //access granted - } - else { + if (!permission_exists('contact_time_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_times_view.php b/core/contacts/contact_times_view.php index de10574e72..b36b730c74 100644 --- a/core/contacts/contact_times_view.php +++ b/core/contacts/contact_times_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_time_view')) { - //access granted - } - else { + if (!permission_exists('contact_time_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_url_edit.php b/core/contacts/contact_url_edit.php index e6a24bde66..cd05671252 100644 --- a/core/contacts/contact_url_edit.php +++ b/core/contacts/contact_url_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_url_edit') || permission_exists('contact_url_add')) { - //access granted - } - else { + if (!permission_exists('contact_url_edit') || !permission_exists('contact_url_add')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_urls.php b/core/contacts/contact_urls.php index 4034091c64..7275e8f678 100644 --- a/core/contacts/contact_urls.php +++ b/core/contacts/contact_urls.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_url_view')) { - //access granted - } - else { + if (!permission_exists('contact_url_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_urls_view.php b/core/contacts/contact_urls_view.php index 872781ed3f..fd2cc9c04a 100644 --- a/core/contacts/contact_urls_view.php +++ b/core/contacts/contact_urls_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_url_view')) { - //access granted - } - else { + if (!permission_exists('contact_url_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contact_view.php b/core/contacts/contact_view.php index 14ef9476ae..64b85710b4 100644 --- a/core/contacts/contact_view.php +++ b/core/contacts/contact_view.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('contact_view')) { - //access granted - } - else { + if (!permission_exists('contact_view')) { echo "access denied"; exit; } diff --git a/core/contacts/contacts.php b/core/contacts/contacts.php index 1abf0b7020..64e4a27e2e 100644 --- a/core/contacts/contacts.php +++ b/core/contacts/contacts.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('contact_view')) { - //access granted - } - else { + if (!permission_exists('contact_view')) { echo "access denied"; exit; } diff --git a/core/dashboard/dashboard.php b/core/dashboard/dashboard.php index 053f182fb3..7b81904908 100644 --- a/core/dashboard/dashboard.php +++ b/core/dashboard/dashboard.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('dashboard_view')) { - //access granted - } - else { + if (!permission_exists('dashboard_view')) { echo "access denied"; exit; } diff --git a/core/dashboard/dashboard_config_json.php b/core/dashboard/dashboard_config_json.php index 94db309d37..147d39dd37 100644 --- a/core/dashboard/dashboard_config_json.php +++ b/core/dashboard/dashboard_config_json.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('dashboard_edit')) { - //access granted - } - else { + if (!permission_exists('dashboard_edit')) { echo "access denied"; exit; } diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 19684904cd..fd85ebd3b1 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('dashboard_add') || permission_exists('dashboard_edit')) { - //access granted - } - else { + if (!permission_exists('dashboard_add') || !permission_exists('dashboard_edit')) { echo "access denied"; exit; } diff --git a/core/dashboard/dashboard_widget_edit.php b/core/dashboard/dashboard_widget_edit.php index ee59682d64..d7ce10f690 100644 --- a/core/dashboard/dashboard_widget_edit.php +++ b/core/dashboard/dashboard_widget_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('dashboard_widget_add') || permission_exists('dashboard_widget_edit')) { - //access granted - } - else { + if (!permission_exists('dashboard_widget_add') || !permission_exists('dashboard_widget_edit')) { echo "access denied"; exit; } diff --git a/core/dashboard/dashboard_widget_list.php b/core/dashboard/dashboard_widget_list.php index 243b5bbbec..761436f376 100644 --- a/core/dashboard/dashboard_widget_list.php +++ b/core/dashboard/dashboard_widget_list.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('dashboard_widget_view')) { - //access granted - } - else { + if (!permission_exists('dashboard_widget_view')) { echo "access denied"; exit; } diff --git a/core/databases/database_edit.php b/core/databases/database_edit.php index 706adfae0c..69ad05d141 100644 --- a/core/databases/database_edit.php +++ b/core/databases/database_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('database_add') || permission_exists('database_edit')) { - //access granted - } - else { + if (!permission_exists('database_add') || !permission_exists('database_edit')) { echo "access denied"; exit; } diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index f68b63ab52..03682f89c9 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('default_setting_add') || permission_exists('default_setting_edit')) { - //access granted - } - else { + if (!permission_exists('default_setting_add') || !permission_exists('default_setting_edit')) { echo "access denied"; exit; } diff --git a/core/default_settings/default_setting_toggle.php b/core/default_settings/default_setting_toggle.php index 287d7a8ecf..a16fd7b194 100644 --- a/core/default_settings/default_setting_toggle.php +++ b/core/default_settings/default_setting_toggle.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('default_setting_edit')) { - //access granted - } - else { + if (!permission_exists('default_setting_edit')) { echo "access denied"; exit; } diff --git a/core/default_settings/default_settings.php b/core/default_settings/default_settings.php index f1d17e4451..dfed37ce34 100644 --- a/core/default_settings/default_settings.php +++ b/core/default_settings/default_settings.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('default_setting_view')) { - //access granted - } - else { + if (!permission_exists('default_setting_view')) { echo "access denied"; exit; } diff --git a/core/default_settings/default_settings_reload.php b/core/default_settings/default_settings_reload.php index f6cf5e17cf..7875d0c451 100644 --- a/core/default_settings/default_settings_reload.php +++ b/core/default_settings/default_settings_reload.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions -if (permission_exists('default_setting_view')) { - //access granted -} -else { +if (!permission_exists('default_setting_view')) { echo "access denied"; exit; } diff --git a/core/domain_settings/domain_setting_edit.php b/core/domain_settings/domain_setting_edit.php index 42f794f85c..31403eef0c 100644 --- a/core/domain_settings/domain_setting_edit.php +++ b/core/domain_settings/domain_setting_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('domain_setting_add') || permission_exists('domain_setting_edit')) { - //access granted - } - else { + if (!permission_exists('domain_setting_add') || !permission_exists('domain_setting_edit')) { echo "access denied"; exit; } diff --git a/core/domain_settings/domain_settings.php b/core/domain_settings/domain_settings.php index dd07b91644..b1cfef283e 100644 --- a/core/domain_settings/domain_settings.php +++ b/core/domain_settings/domain_settings.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('domain_setting_view')) { - //access granted - } - else { + if (!permission_exists('domain_setting_view')) { echo "access denied"; exit; } diff --git a/core/domain_settings/resources/classes/domain_settings.php b/core/domain_settings/resources/classes/domain_settings.php index f0d50c514d..5c6aed2715 100644 --- a/core/domain_settings/resources/classes/domain_settings.php +++ b/core/domain_settings/resources/classes/domain_settings.php @@ -42,6 +42,7 @@ /** * declare public variables */ + public $domain_uuid; public $domain_uuid_target; /** @@ -59,7 +60,6 @@ /** * declare private variables */ - private $domain_uuid; private $permission_prefix; private $list_page; private $table; diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index ab12b7850d..bd76710914 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -30,10 +30,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('domain_all') && permission_exists('domain_edit')) { - //access granted - } - else { + if (!permission_exists('domain_all') && !permission_exists('domain_edit')) { echo "access denied"; exit; } diff --git a/core/domains/domain_json.php b/core/domains/domain_json.php index 0b13473989..104a85bdc3 100644 --- a/core/domains/domain_json.php +++ b/core/domains/domain_json.php @@ -27,12 +27,9 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - + //check permissions - if (permission_exists('domain_view')) { - //access granted - } - else { + if (!permission_exists('domain_view')) { echo "access denied"; exit; } diff --git a/core/email_templates/email_template_edit.php b/core/email_templates/email_template_edit.php index 1d2ae869b1..e9bff22af8 100644 --- a/core/email_templates/email_template_edit.php +++ b/core/email_templates/email_template_edit.php @@ -26,10 +26,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('email_template_add') || permission_exists('email_template_edit')) { - //access granted - } - else { + if (!permission_exists('email_template_add') || !permission_exists('email_template_edit')) { echo "access denied"; exit; } diff --git a/core/email_templates/email_templates.php b/core/email_templates/email_templates.php index fc2d2c0927..3270340f8d 100644 --- a/core/email_templates/email_templates.php +++ b/core/email_templates/email_templates.php @@ -27,10 +27,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('email_template_view')) { - //access granted - } - else { + if (!permission_exists('email_template_view')) { echo "access denied"; exit; } diff --git a/core/groups/group_edit.php b/core/groups/group_edit.php index e162d55ef3..7676508209 100644 --- a/core/groups/group_edit.php +++ b/core/groups/group_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('group_add') || permission_exists('group_edit')) { - //access granted - } - else { + if (!permission_exists('group_add') || !permission_exists('group_edit')) { echo "access denied"; exit; } diff --git a/core/groups/group_member_add.php b/core/groups/group_member_add.php index bf14b98449..2881126f6f 100644 --- a/core/groups/group_member_add.php +++ b/core/groups/group_member_add.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('group_member_add') || if_group("superadmin")) { - //access allowed - } - else { + if (!permission_exists('group_member_add')) { echo "access denied"; return; } diff --git a/core/groups/group_members.php b/core/groups/group_members.php index f5e603f4d8..21d6c5cab5 100644 --- a/core/groups/group_members.php +++ b/core/groups/group_members.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('group_member_view') || if_group("superadmin")) { - //access allowed - } - else { + if (!permission_exists('group_member_view')) { echo "access denied"; return; } diff --git a/core/groups/group_permissions.php b/core/groups/group_permissions.php index 4f38e63e9c..c47fcbb750 100644 --- a/core/groups/group_permissions.php +++ b/core/groups/group_permissions.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('group_permission_view')) { - //access granted - } - else { + if (!permission_exists('group_permission_view')) { echo "access denied"; exit; } diff --git a/core/groups/groups.php b/core/groups/groups.php index cf5dd049a5..075926ac1e 100644 --- a/core/groups/groups.php +++ b/core/groups/groups.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('group_view')) { - //access granted - } - else { + if (!permission_exists('group_view')) { echo "access denied"; exit; } diff --git a/core/groups/permissions_copy.php b/core/groups/permissions_copy.php index c9d0aa18af..a4a3e0aaae 100644 --- a/core/groups/permissions_copy.php +++ b/core/groups/permissions_copy.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('group_permission_add')) { - //access granted - } - else { + if (!permission_exists('group_permission_add')) { echo "access denied"; exit; } diff --git a/core/menu/menu.php b/core/menu/menu.php index 0686bf20aa..762078c03c 100644 --- a/core/menu/menu.php +++ b/core/menu/menu.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('menu_view')) { - //access granted - } - else { + if (!permission_exists('menu_view')) { echo "access denied"; exit; } diff --git a/core/menu/menu_edit.php b/core/menu/menu_edit.php index abe162c478..4108209b13 100644 --- a/core/menu/menu_edit.php +++ b/core/menu/menu_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('menu_add') || permission_exists('menu_edit')) { - //access granted - } - else { + if (!permission_exists('menu_add') || !permission_exists('menu_edit')) { echo "access denied"; exit; } diff --git a/core/menu/menu_item_edit.php b/core/menu/menu_item_edit.php index 6d637b0c48..dc4ec6ec47 100644 --- a/core/menu/menu_item_edit.php +++ b/core/menu/menu_item_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('menu_add') || permission_exists('menu_edit')) { - //access granted - } - else { + if (!permission_exists('menu_add') || !permission_exists('menu_edit')) { echo "access denied"; return; } diff --git a/core/menu/menu_item_list.php b/core/menu/menu_item_list.php index 9a0573e448..c34c4a0e3d 100644 --- a/core/menu/menu_item_list.php +++ b/core/menu/menu_item_list.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('menu_add') || permission_exists('menu_edit') || permission_exists('menu_delete')) { - //access granted - } - else { + if (!permission_exists('menu_add') || !permission_exists('menu_edit') || !permission_exists('menu_delete')) { echo "access denied"; exit; } @@ -90,7 +87,9 @@ //add the build db child menu list function build_db_child_menu_list ($database, $menu_item_level, $menu_item_uuid) { - global $menu_uuid, $list_row_edit_button, $tmp_menu_item_order, $v_link_label_edit, $v_link_label_delete, $page, $text, $x; + global $settings, $menu_uuid, $list_row_edit_button; + global $tmp_menu_item_order, $v_link_label_edit, $v_link_label_delete; + global $page, $text, $x; //check for sub menus $menu_item_level = $menu_item_level+1; diff --git a/core/menu/menu_item_move_down.php b/core/menu/menu_item_move_down.php index 9871c2bf55..3483682e6d 100644 --- a/core/menu/menu_item_move_down.php +++ b/core/menu/menu_item_move_down.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('menu_edit')) { - //access granted - } - else { + if (!permission_exists('menu_edit')) { echo "access denied"; return; } diff --git a/core/menu/menu_item_move_up.php b/core/menu/menu_item_move_up.php index 9b967156fb..ff9d1a1426 100644 --- a/core/menu/menu_item_move_up.php +++ b/core/menu/menu_item_move_up.php @@ -28,10 +28,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('menu_edit')) { - //access granted - } - else { + if (!permission_exists('menu_edit')) { echo "access denied"; return; } diff --git a/core/menu/menu_reload.php b/core/menu/menu_reload.php index 92166a5039..f6df18730c 100644 --- a/core/menu/menu_reload.php +++ b/core/menu/menu_reload.php @@ -27,12 +27,9 @@ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; - + //check permissions - if (permission_exists('menu_add') || permission_exists('menu_edit')) { - //access granted - } - else { + if (!permission_exists('menu_add') || !permission_exists('menu_edit')) { echo "access denied"; return; } diff --git a/core/menu/menu_restore_default.php b/core/menu/menu_restore_default.php index 8606269c25..0bd825b12c 100644 --- a/core/menu/menu_restore_default.php +++ b/core/menu/menu_restore_default.php @@ -30,10 +30,7 @@ //check permissions if(!defined('STDIN')) { require_once "resources/check_auth.php"; - if (permission_exists('menu_restore')) { - //access granted - } - else { + if (!permission_exists('menu_restore')) { echo "access denied"; return; } diff --git a/core/notifications/notification_edit.php b/core/notifications/notification_edit.php index 9d5fb323b3..0a1e5eed6c 100644 --- a/core/notifications/notification_edit.php +++ b/core/notifications/notification_edit.php @@ -30,9 +30,6 @@ Mark J Crane //check permissions if (if_group('superadmin')) { - //access granted - } - else { echo "access denied"; exit; } diff --git a/core/upgrade/upgrade.php b/core/upgrade/upgrade.php index 3d46baac08..a32e4c8f50 100644 --- a/core/upgrade/upgrade.php +++ b/core/upgrade/upgrade.php @@ -152,10 +152,7 @@ } else { require_once "resources/check_auth.php"; - if (permission_exists('upgrade_schema') || permission_exists('upgrade_source') || if_group("superadmin")) { - //echo "access granted"; - } - else { + if (!permission_exists('upgrade_schema') || !permission_exists('upgrade_source')) { echo "access denied"; exit; } diff --git a/core/upgrade/upgrade_domains.php b/core/upgrade/upgrade_domains.php index e2d1692b0a..69525db3a0 100644 --- a/core/upgrade/upgrade_domains.php +++ b/core/upgrade/upgrade_domains.php @@ -47,7 +47,6 @@ //run all app_defaults.php files $domain = new domains; - $domain->display_type = $display_type; $domain->upgrade(); ?> diff --git a/core/user_logs/user_log_edit.php b/core/user_logs/user_log_edit.php index 0053b16aa0..a7711a5456 100644 --- a/core/user_logs/user_log_edit.php +++ b/core/user_logs/user_log_edit.php @@ -5,10 +5,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('user_log_view')) { - //access granted - } - else { + if (!permission_exists('user_log_view')) { echo "access denied"; exit; } diff --git a/core/user_logs/user_logs.php b/core/user_logs/user_logs.php index dfae9687f8..deef7796a3 100644 --- a/core/user_logs/user_logs.php +++ b/core/user_logs/user_logs.php @@ -27,10 +27,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('user_log_view')) { - //access granted - } - else { + if (!permission_exists('user_log_view')) { echo "access denied"; exit; } diff --git a/core/user_settings/user_setting_edit.php b/core/user_settings/user_setting_edit.php index d98e2969f6..37345c1635 100644 --- a/core/user_settings/user_setting_edit.php +++ b/core/user_settings/user_setting_edit.php @@ -29,10 +29,7 @@ require_once "resources/check_auth.php"; //check permissions - if (permission_exists('user_setting_add') || permission_exists('user_setting_edit')) { - //access granted - } - else { + if (!permission_exists('user_setting_add') || !permission_exists('user_setting_edit')) { echo "access denied"; exit; } diff --git a/core/user_settings/user_settings.php b/core/user_settings/user_settings.php index abd5dd0024..72a8fff5f5 100644 --- a/core/user_settings/user_settings.php +++ b/core/user_settings/user_settings.php @@ -30,10 +30,7 @@ require_once "resources/paging.php"; //check permissions - if (permission_exists('user_setting_view')) { - //access granted - } - else { + if (!permission_exists('user_setting_view')) { echo "access denied"; exit; }