From c09b7f80efacb4593d1e0efd39198b15ebfc06c7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 14 Jun 2016 11:14:06 -0600 Subject: [PATCH] Update gateways.php Add an 'or domain_uuid is null' if permission gateway_domain is given to the group. --- app/gateways/gateways.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php index dfc5336d70..d1d8ed4474 100644 --- a/app/gateways/gateways.php +++ b/app/gateways/gateways.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2016 the Initial Developer. All Rights Reserved. Contributor(s): @@ -101,7 +101,12 @@ else { echo "
\n"; //get total gateway count from the database - $sql = "select count(*) as num_rows from v_gateways where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql = "select count(*) as num_rows from v_gateways "; + $sql .= "where ( domain_uuid = '".$_SESSION['domain_uuid']."' "; + if (permission_exists('gateway_domain') { + $sql .= "or domain_uuid is null "; + } + $sql .= ");"; $prep_statement = $db->prepare($sql); if ($prep_statement) { $prep_statement->execute(); @@ -120,7 +125,11 @@ else { //get the list $sql = "select * from v_gateways "; - $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) "; + $sql .= "where ( domain_uuid = '".$_SESSION['domain_uuid']."' "; + if (permission_exists('gateway_domain') { + $sql .= "or domain_uuid is null "; + } + $sql .= ");"; if (strlen($order_by) == 0) { $sql .= "order by gateway asc "; } @@ -232,4 +241,4 @@ else { //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?>