Destinations - Edit: Fix cross-domain (via Show All) edit bug.

This commit is contained in:
Nate
2020-04-11 15:17:46 -06:00
parent 27a1a3b805
commit 49f4c166bc

View File

@@ -42,9 +42,6 @@
$language = new text;
$text = $language->get();
//initialize the destinations object
$destination = new destinations;
//action add or update
if (is_uuid($_REQUEST["id"])) {
$action = "update";
@@ -122,6 +119,12 @@
//process the http post
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//initialize the destinations object
$destination = new destinations;
if (permission_exists('destination_domain') && is_uuid($domain_uuid)) {
$destination->domain_uuid = $domain_uuid;
}
//get the uuid
if ($action == "update" && is_uuid($_POST["destination_uuid"])) {
$destination_uuid = trim($_POST["destination_uuid"]);
@@ -701,9 +704,7 @@
if (is_uuid($_GET["id"])) {
$destination_uuid = $_GET["id"];
$sql = "select * from v_destinations ";
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
$sql .= "and destination_uuid = :destination_uuid ";
$parameters['domain_uuid'] = $domain_uuid;
$sql .= "where destination_uuid = :destination_uuid ";
$parameters['destination_uuid'] = $destination_uuid;
$database = new database;
$row = $database->select($sql, $parameters, 'row');
@@ -794,6 +795,12 @@
if ($destination_type =="outbound") { $destination_context = $_SESSION['domain_name']; }
//if ($destination_type =="local") { $destination_context = $_SESSION['domain_name']; }
//initialize the destinations object
$destination = new destinations;
if (permission_exists('destination_domain') && is_uuid($domain_uuid)) {
$destination->domain_uuid = $domain_uuid;
}
//create token
$object = new token;
$token = $object->create($_SERVER['PHP_SELF']);