Ensure destination cache is cleared when destination is saved by a user in the admin group.
This commit is contained in:
@@ -189,6 +189,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//get the uuid
|
||||||
|
if ($action == "update" && is_uuid($_POST["destination_uuid"])) {
|
||||||
|
$destination_uuid = $_POST["destination_uuid"];
|
||||||
|
}
|
||||||
|
|
||||||
//get the destination row values
|
//get the destination row values
|
||||||
if ($action == 'update' && is_uuid($destination_uuid)) {
|
if ($action == 'update' && is_uuid($destination_uuid)) {
|
||||||
$sql = "select * from v_destinations ";
|
$sql = "select * from v_destinations ";
|
||||||
@@ -199,9 +204,16 @@
|
|||||||
unset($sql, $parameters);
|
unset($sql, $parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the dialplan_uuid from the database
|
//get the destination settings from the database
|
||||||
if (is_array($row) && @sizeof($row) != 0) {
|
if (is_array($row) && @sizeof($row) != 0) {
|
||||||
|
//get the dialplan_uuid from the database
|
||||||
$dialplan_uuid = $row["dialplan_uuid"];
|
$dialplan_uuid = $row["dialplan_uuid"];
|
||||||
|
|
||||||
|
//if the destination_number is not set then get it from the database
|
||||||
|
if (!isset($destination_number)) {
|
||||||
|
$destination_prefix = $row["destination_prefix"];
|
||||||
|
$destination_number = $row["destination_number"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the user doesn't have the correct permission then
|
//if the user doesn't have the correct permission then
|
||||||
@@ -768,14 +780,19 @@
|
|||||||
|
|
||||||
//clear the cache
|
//clear the cache
|
||||||
$cache = new cache;
|
$cache = new cache;
|
||||||
$cache->delete("dialplan:".$destination_context);
|
if ($_SESSION['destinations']['dialplan_mode']['text'] == 'multiple') {
|
||||||
if (isset($destination_number) && is_numeric($destination_number)) {
|
$cache->delete("dialplan:".$destination_context);
|
||||||
$cache->delete("dialplan:".$destination_context.":".$destination_number);
|
|
||||||
}
|
}
|
||||||
if (isset($destination_prefix) && is_numeric($destination_prefix) && isset($destination_number) && is_numeric($destination_number)) {
|
if ($_SESSION['destinations']['dialplan_mode']['text'] == 'single') {
|
||||||
$cache->delete("dialplan:".$destination_context.":".$destination_prefix.$destination_number);
|
if (isset($destination_number) && is_numeric($destination_number)) {
|
||||||
|
$cache->delete("dialplan:".$destination_context.":".$destination_number);
|
||||||
|
}
|
||||||
|
if (isset($destination_prefix) && is_numeric($destination_prefix) && isset($destination_number) && is_numeric($destination_number)) {
|
||||||
|
$cache->delete("dialplan:".$destination_context.":".$destination_prefix.$destination_number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
} //if $destination_type == inbound
|
||||||
|
|
||||||
//save the outbound destination
|
//save the outbound destination
|
||||||
if ($destination_type == 'outbound') {
|
if ($destination_type == 'outbound') {
|
||||||
@@ -821,7 +838,7 @@
|
|||||||
unset($_SESSION['destinations']['array']);
|
unset($_SESSION['destinations']['array']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} //if destination_type == outbound
|
||||||
|
|
||||||
//redirect the user
|
//redirect the user
|
||||||
if ($action == "add") {
|
if ($action == "add") {
|
||||||
|
|||||||
Reference in New Issue
Block a user