Update gateways.php

Add an 'or domain_uuid is null' if permission gateway_domain is given to the group.
This commit is contained in:
FusionPBX 2016-06-14 11:14:06 -06:00 committed by GitHub
parent 653e64b6dd
commit c09b7f80ef
1 changed files with 13 additions and 4 deletions

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
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 "<br />\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";
?>
?>