From 68b4a0fa38dc6aae7ccddd60b968a87d7c7359cd Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 22 Jan 2015 11:18:34 +0000 Subject: [PATCH] Allow the gateway domain_uuid to be null to support global gateways. --- app/gateways/gateway_edit.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/gateways/gateway_edit.php b/app/gateways/gateway_edit.php index aed6acf828..0fd695bd5a 100644 --- a/app/gateways/gateway_edit.php +++ b/app/gateways/gateway_edit.php @@ -143,7 +143,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $gateway_uuid = uuid(); $sql = "insert into v_gateways "; $sql .= "("; - $sql .= "domain_uuid, "; + if (strlen($domain_uuid) > 0) { + $sql .= "domain_uuid, "; + } $sql .= "gateway_uuid, "; $sql .= "gateway, "; $sql .= "username, "; @@ -175,7 +177,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= ")"; $sql .= "values "; $sql .= "("; - $sql .= "'$domain_uuid', "; + if (strlen($domain_uuid) > 0) { + $sql .= "'$domain_uuid', "; + } $sql .= "'$gateway_uuid', "; $sql .= "'$gateway', "; $sql .= "'$username', "; @@ -236,7 +240,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "extension_in_contact = '$extension_in_contact', "; $sql .= "context = '$context', "; $sql .= "profile = '$profile', "; - $sql .= "domain_uuid = '$domain_uuid', "; + if (strlen($domain_uuid) == 0) { + $sql .= "domain_uuid = null, "; + } + else { + $sql .= "domain_uuid = '$domain_uuid', "; + } $sql .= "enabled = '$enabled', "; $sql .= "description = '$description' "; $sql .= "where gateway_uuid = '$gateway_uuid'";