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 +?>