From 49f4c166bc9e904fcd893ef9035d86e3ede73aaf Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 11 Apr 2020 15:17:46 -0600 Subject: [PATCH] Destinations - Edit: Fix cross-domain (via Show All) edit bug. --- app/destinations/destination_edit.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 88a79dc57d..a58c4493fc 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -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']);