Update check permisisons

This commit is contained in:
markjcrane
2025-11-02 00:22:57 -06:00
parent 422fee7f23
commit b0eabca1f6
243 changed files with 299 additions and 1008 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}