Fix the ring group message for add or update.

This commit is contained in:
FusionPBX 2019-09-05 07:45:02 -06:00 committed by GitHub
parent a811a0566c
commit 9fa9e30833
1 changed files with 6 additions and 13 deletions

View File

@ -77,9 +77,12 @@
}
//action add or update
if (is_uuid($_REQUEST["id"])) {
if (is_uuid($_REQUEST["id"]) || is_uuid($_REQUEST["ring_group_uuid"])) {
$action = "update";
$ring_group_uuid = $_REQUEST["id"];
if (is_uuid($_REQUEST["ring_group_uuid"])) {
$ring_group_uuid = $_REQUEST["ring_group_uuid"];
}
}
else {
$action = "add";
@ -146,12 +149,7 @@
}
//assign the user to the ring group
if (
is_uuid($_REQUEST["user_uuid"])
&& is_uuid($_REQUEST["id"])
&& $_GET["a"] != "delete"
&& permission_exists("ring_group_edit")
) {
if (is_uuid($_REQUEST["user_uuid"]) && is_uuid($_REQUEST["id"]) && $_GET["a"] != "delete" && permission_exists("ring_group_edit")) {
//set the variables
$user_uuid = $_REQUEST["user_uuid"];
$extension_uuid = $_REQUEST["id"];
@ -181,11 +179,6 @@
//process the HTTP POST
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//get the ring group uuid
if ($action = 'add') {
$_POST["ring_group_uuid"] = $ring_group_uuid;
}
//check for all required data
$msg = '';
if (strlen($ring_group_name) == 0) { $msg .= $text['message-name']."<br>\n"; }
@ -369,7 +362,7 @@
//save the message to a session variable
message::add($text['message-add']);
//redirect the browser
header("Location: ring_group_edit.php?id=$ring_group_uuid");
header("Location: ring_group_edit.php?id=".urlencode($ring_group_uuid));
exit;
}
if ($action == "update") {