Update gateway_edit.php

If permission to view all gateways then add an 'or domain_uuid is null'
This commit is contained in:
FusionPBX
2016-06-14 11:10:53 -06:00
committed by GitHub
parent dccb0e5dc4
commit 521bf62695

View File

@@ -50,7 +50,12 @@ else {
//get total gateway count from the database, check limit, if defined
if ($action == 'add') {
if ($_SESSION['limit']['gateways']['numeric'] != '') {
$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();
@@ -961,4 +966,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
//include the footer
require_once "resources/footer.php";
?>
?>