Fix the permissions for admin using the time conditions and dialplan -> destinations.
This commit is contained in:
@@ -49,6 +49,11 @@ else {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//add the dialplan permission
|
||||||
|
$permission = "dialplan_delete";
|
||||||
|
$p = new permissions;
|
||||||
|
$p->add($permission, 'temp');
|
||||||
|
|
||||||
//get the dialplan_uuid
|
//get the dialplan_uuid
|
||||||
$orm = new orm;
|
$orm = new orm;
|
||||||
$orm->name('destinations');
|
$orm->name('destinations');
|
||||||
@@ -63,6 +68,9 @@ else {
|
|||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
|
//remove the temporary permission
|
||||||
|
$p->delete($permission, 'temp');
|
||||||
|
|
||||||
//start the atomic transaction
|
//start the atomic transaction
|
||||||
$db->beginTransaction();
|
$db->beginTransaction();
|
||||||
|
|
||||||
|
|||||||
@@ -374,6 +374,11 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
unset($sql);
|
unset($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//add the dialplan permission
|
||||||
|
$permission = "dialplan_delete";
|
||||||
|
$p = new permissions;
|
||||||
|
$p->add($permission, 'temp');
|
||||||
|
|
||||||
//save the dialplan
|
//save the dialplan
|
||||||
$orm = new orm;
|
$orm = new orm;
|
||||||
$orm->name('dialplans');
|
$orm->name('dialplans');
|
||||||
@@ -383,6 +388,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
$orm->save($dialplan);
|
$orm->save($dialplan);
|
||||||
$dialplan_response = $orm->message;
|
$dialplan_response = $orm->message;
|
||||||
|
|
||||||
|
//remove the temporary permission
|
||||||
|
$p->delete($permission, 'temp');
|
||||||
|
|
||||||
//synchronize the xml config
|
//synchronize the xml config
|
||||||
save_dialplan_xml();
|
save_dialplan_xml();
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ else {
|
|||||||
//delete dialplan and details
|
//delete dialplan and details
|
||||||
$dialplans_deleted = 0;
|
$dialplans_deleted = 0;
|
||||||
foreach ($dialplan_uuids as $dialplan_uuid) {
|
foreach ($dialplan_uuids as $dialplan_uuid) {
|
||||||
|
|
||||||
//delete child data
|
//delete child data
|
||||||
$sql = "delete from v_dialplan_details ";
|
$sql = "delete from v_dialplan_details ";
|
||||||
$sql .= "where dialplan_uuid = '".$dialplan_uuid."' ";
|
$sql .= "where dialplan_uuid = '".$dialplan_uuid."' ";
|
||||||
|
|||||||
@@ -92,11 +92,9 @@ require_once "resources/header.php";
|
|||||||
$dialplan_name = str_replace(' ', '_', $dialplan_name);
|
$dialplan_name = str_replace(' ', '_', $dialplan_name);
|
||||||
$dialplan_name = str_replace('/', '', $dialplan_name);
|
$dialplan_name = str_replace('/', '', $dialplan_name);
|
||||||
|
|
||||||
|
|
||||||
//start the atomic transaction
|
//start the atomic transaction
|
||||||
$count = $db->exec("BEGIN;"); //returns affected rows
|
$count = $db->exec("BEGIN;"); //returns affected rows
|
||||||
|
|
||||||
|
|
||||||
//process main dialplan entry
|
//process main dialplan entry
|
||||||
if ($action == "add") {
|
if ($action == "add") {
|
||||||
|
|
||||||
@@ -453,6 +451,11 @@ require_once "resources/header.php";
|
|||||||
//get existing data to pre-populate form
|
//get existing data to pre-populate form
|
||||||
if ($dialplan_uuid != '' && $_POST["persistformvar"] != "true") {
|
if ($dialplan_uuid != '' && $_POST["persistformvar"] != "true") {
|
||||||
|
|
||||||
|
//add the dialplan permission
|
||||||
|
$permission = "dialplan_edit";
|
||||||
|
$p = new permissions;
|
||||||
|
$p->add($permission, 'temp');
|
||||||
|
|
||||||
//get main dialplan entry
|
//get main dialplan entry
|
||||||
$orm = new orm;
|
$orm = new orm;
|
||||||
$orm->name('dialplans');
|
$orm->name('dialplans');
|
||||||
@@ -472,6 +475,9 @@ require_once "resources/header.php";
|
|||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
|
//remove the temporary permission
|
||||||
|
$p->delete($permission, 'temp');
|
||||||
|
|
||||||
//get dialplan detail conditions
|
//get dialplan detail conditions
|
||||||
$sql = "select dialplan_detail_group, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data from v_dialplan_details ";
|
$sql = "select dialplan_detail_group, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data from v_dialplan_details ";
|
||||||
$sql .= "where dialplan_uuid = '".$dialplan_uuid."' ";
|
$sql .= "where dialplan_uuid = '".$dialplan_uuid."' ";
|
||||||
|
|||||||
Reference in New Issue
Block a user