mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Misc: Implement maximum limits on multiple apps.
This commit is contained in:
@@ -67,6 +67,26 @@ else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get total ring group count from the database, check limit, if defined
|
||||
if ($action == 'add') {
|
||||
if ($_SESSION['limit']['ring_groups']['numeric'] != '') {
|
||||
$sql = "select count(*) as num_rows from v_ring_groups where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
if ($prep_statement) {
|
||||
$prep_statement->execute();
|
||||
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
||||
$total_ring_groups = $row['num_rows'];
|
||||
}
|
||||
unset($prep_statement, $row);
|
||||
if ($total_ring_groups >= $_SESSION['limit']['ring_groups']['numeric']) {
|
||||
$_SESSION['message_mood'] = 'negative';
|
||||
$_SESSION['message'] = $text['message-maximum_ring_groups'].' '.$_SESSION['limit']['ring_groups']['numeric'];
|
||||
header('Location: ring_groups.php');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST) > 0) {
|
||||
//set variables from http values
|
||||
|
||||
Reference in New Issue
Block a user