diff --git a/app/access_controls/access_control_export.php b/app/access_controls/access_control_export.php index e52e0bf52..32d0ccf48 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 605954437..83c780e64 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 a45db3c14..3a3d14b60 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 ea6304338..31d301722 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 116ecc519..45abafc79 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 1d5e92b05..17280e84d 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 27275597c..3d88eb88a 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 76b0aa194..5091b3d23 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 e9e5f47f4..4fc018594 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 83ea7b4cc..5eb7598dd 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 482d7366e..85a455386 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 418516a32..cdd9bece1 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 2487cbe73..a3bef66ea 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 b79529b69..64b86b06c 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 f92832190..bd988bf71 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 95e642744..dcc557e45 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 7e3b05db0..a20ae39e9 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 bd476d2c7..7061705e3 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 9d58ab504..ae3140520 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 da81a3b56..d8952b3af 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 149165bde..643af420e 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 5c9b73bd1..f19137c4a 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 d2abb4e1d..c8dc7c820 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 573a3d543..4171dff8c 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 29c4295e0..a3749817a 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 4595f55dc..0399366b3 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 9e6b25cbf..a7a5b165c 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 38b6f241e..8ace35f70 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 cc644b6b2..f4f0316d9 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 5a2141977..c9efc7de5 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 72d9b1341..73f55f2ec 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 4f85a51bf..54770a194 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 91a58003d..0f2f74e5d 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 db1cf63e6..f12afed89 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 b71c4efa9..eab2a311a 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 81ad8bc35..8121c891e 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 4e5760368..9e07f75d1 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 f07583aab..dd60bc4d3 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 1636d3103..3bd3e112e 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 6b53e1443..22fa6d521 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 c177c6d61..3f61e29a8 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 be51a5dc7..392bf147d 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 fc6a83fea..5ed9c180f 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 94878d260..d4fda16e7 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 5afb27bc2..4c9db3b54 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 55ecddb61..ea23399a3 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 9e16d6a58..4eed1646d 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 283f80e1a..f048c70de 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 b51b1997f..1256c14e4 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 d19697ecf..a45e8eb33 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 69549b208..7bbd943e2 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 a9c115971..03d6f395f 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 2389303da..53f042f09 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 2170dea63..e9a26d77c 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 2b4e2c760..439f275d9 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 96cdd5210..bdd618b28 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 7b5209466..327a7ade4 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 4b477b7a7..0b0c67849 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 8bd5e8d8b..034bd2378 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 34ecc5d14..b1199e290 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 eb63ed7c8..9c408c8db 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 1483fae10..ce27dc44a 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 35e093d17..b2dbdd6c2 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 be44fd773..c30955078 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 e3daf6d0e..9daa4304e 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 e5f4997fe..d7e8a5a9d 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 82dbc5d00..5b341772e 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 6e66ffd7e..f49b79622 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 a1ff3848b..af50f4949 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 e5b50e3f4..7c1ef4f51 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 1ee781406..49cbcd7f8 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 6274c0afc..f3a942553 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 2d212aa6a..2501ed9c1 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 63d382d6a..06dcd620e 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 fe3fb20a1..4bbdd6011 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 f00a160c7..03ab1a0f8 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 3bb5f0a12..8fc41689b 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 9c0f99f19..6c1d93097 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 3bcf1b3ee..7857543b7 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 781ac6fc2..c22d63974 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 0a5988ee1..9cab363a2 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 5020cf589..651a9a3c9 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 7db3264af..94772393e 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 291a2ff81..ec9f4fcb9 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 caa3393e6..afa13417d 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 43aaad038..d61ee187c 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 3b032f5fc..18dd0d515 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 7a0de3fc3..27ad50597 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 670a66a01..130e4a225 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 16e5b71f7..faecefaaf 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 69c2d8197..952bdedcb 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 30d100aae..069e69c5b 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 264f22a09..36677e54b 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 af79e2932..e2d756ab7 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 cb6423c60..7892257e7 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 af8127ff6..16bbf880a 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 19182ebdc..9132144d4 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 cba0a37e3..58221553b 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 94a41e452..837dba655 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 f5e36269b..71fb4c787 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 932bb071f..1ce89cf93 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 a89808739..a86715fc4 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 88386e60c..f7992f6f3 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 4a6f59b75..2faa099b0 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 09efe92a3..660b54efc 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 3ed361ab5..9f429afbc 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 63e625564..47aca61f9 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 6a8438680..f77c48afe 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 9dd42ca78..5786e60c5 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 ea6fbfa9c..0260f0ddc 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 8f51da619..6a0549d23 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 2c8bf6b5e..074294a9c 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 f186466ee..55c924807 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 8a1cfabb8..6e41a2de7 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 af08c45a8..ba07af082 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 24cacc1ae..ab60be473 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 9cb4feb60..311da7926 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 4957ecf2e..788f925fe 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 ec236ec0f..44a6df782 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 fcce1f61e..22353ec56 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 dd617d3f4..9eb8834e1 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 36567b8a9..68551fbad 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 56466766f..23dc00fad 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 c731af0bf..1bb241987 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 539992c11..c41c512f2 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 7541aa9b4..63ff77c67 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 202c29210..670eb1e78 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 f29d760cd..d0b32fd87 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 5c83bd169..91a91478a 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 4fc5f37db..0c7c0ba19 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 26a65cc66..ef2f46759 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 b4696bfd9..62bf64bc7 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 33e9ac39b..c8f1c72a3 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 e58d7999b..628dbfccd 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 eab968178..c91c4bda3 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 3abd87481..793de49ff 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 4f20cc8bf..6f70b7fbc 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 f6c23ba14..95314c4b6 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 804f37d93..02efc22aa 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 035725f06..71cca7cc5 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 adb85dcd4..b1c47036a 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 b96e1951c..dc585c588 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 f2cb7ac34..825f08b5a 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 cc70dc33e..66ac63428 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 d43f50030..102e6cab0 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 648ee44d0..b396935e8 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 1152521a6..14795180b 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 6ee351a7c..5b4a7749a 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 58bcab229..0a9f67d63 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 f07ac7c75..96238d3ab 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 c3f27ae3b..755ce5c7e 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 8dd860d51..a99d41fbf 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 fb34ddd0f..494aa1a12 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 e19d2f9e9..d515b2880 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 982119d6d..8276144c2 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 cac05c890..4ee2dd246 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 11bf09091..25dfc93ff 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 89ac2faa7..fd8fe8076 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 5fa2cbbb6..1534eadfc 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 d339d2b49..118aaf169 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 bbbf662a9..db0af73f1 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 5730c997c..f8c8a2889 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 da1afc7c0..1998817ca 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 24d6c3070..a987bba7f 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 1b2ea70a6..82d10a896 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 259fa0b5d..bd1921381 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 5070c9e4c..37063501b 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 a8c335162..387033d53 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 8dd71f926..78e4744c1 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 9ab289f08..51c97187c 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 1e45aa5a2..a1439ee9c 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 da2ba1e09..7722f5b8b 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 c083e77a2..5d3809715 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 b370bb1ec..92a21056b 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 3d3d0c593..7cb1b8ffe 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 365a81484..c1b4acd40 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 4d5dc4b83..ba13c5f5c 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 fe376bc26..594757800 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 da7a143bc..553eaba25 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 0eff7600e..e7f737501 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 f9994cdc0..02f7be8c3 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 edb5076ac..8f8e691a9 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 c9bf97470..bcb35cbc7 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 8fe47a4ad..c0e92693e 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 cace77a2a..c9e9d7cb9 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 b8264702f..90cf21823 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 dabaf5c45..2f60da8f0 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 4f23886b1..76ad16f2a 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 47b323d0b..a9db5579e 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 3e2d64847..646f2b93c 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 e083b9f50..fb4e29e0b 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 838553ea8..a5f4107ce 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 265ab9473..3a103e83b 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 8c7c875a4..f9afe03b2 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 28cd9914d..b5101deb5 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 c48ba7942..69f2c0428 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 8ba542938..565a665af 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 1168e2a3f..8988e34c3 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 94d1b6731..1577e029a 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 de10574e7..b36b730c7 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 e6a24bde6..cd0567125 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 4034091c6..7275e8f67 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 872781ed3..fd2cc9c04 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 14ef9476a..64b85710b 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 1abf0b702..64e4a27e2 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 053f182fb..7b8190490 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 94db309d3..147d39dd3 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 19684904c..fd85ebd3b 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 ee59682d6..d7ce10f69 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 243b5bbbe..761436f37 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 706adfae0..69ad05d14 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 f68b63ab5..03682f89c 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 287d7a8ec..a16fd7b19 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 f1d17e445..dfed37ce3 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 f6cf5e17c..7875d0c45 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 42f794f85..31403eef0 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 dd07b9164..b1cfef283 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 f0d50c514..5c6aed271 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 ab12b7850..bd7671091 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 0b1347398..104a85bdc 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 1d2ae869b..e9bff22af 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 fc2d2c092..3270340f8 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 e162d55ef..767650820 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 bf14b9844..2881126f6 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 f5e603f4d..21d6c5cab 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 4f38e63e9..c47fcbb75 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 cf5dd049a..075926ac1 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 c9d0aa18a..a4a3e0aaa 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 0686bf20a..762078c03 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 abe162c47..4108209b1 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 6d637b0c4..dc4ec6ec4 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 9a0573e44..c34c4a0e3 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 9871c2bf5..3483682e6 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 9b967156f..ff9d1a142 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 92166a503..f6df18730 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 8606269c2..0bd825b12 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 9d5fb323b..0a1e5eed6 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 3d46baac0..a32e4c8f5 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 e2d1692b0..69525db3a 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 0053b16aa..a7711a545 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 dfae9687f..deef7796a 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 d98e2969f..37345c163 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 abd5dd002..72a8fff5f 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; }