mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-29 16:43:50 +00:00
Display message for limits instead of hiding add and copy buttons (#7681)
* Display message for limits instead of hiding add and copy buttons * Update ivr_menus.php * Update gateways.php * Update extensions.php * Update devices.php * Update call_center_queues.php * Update app_languages.php * Update voicemail_greetings.php * Update users.php * Update voicemail_greetings.php * Update call_center_queues.php
This commit is contained in:
@@ -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-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -55,6 +55,21 @@
|
||||
$call_center_queues = $_POST['call_center_queues'];
|
||||
}
|
||||
|
||||
//get total call center queues count from the database, check limit, if defined
|
||||
if (!empty($action) && $action == 'copy' && !empty($settings->get('limit','call_center_queues', ''))) {
|
||||
$sql = "select count(*) from v_call_center_queues ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$total_call_center_queues = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if ($total_call_center_queues >= $settings->get('limit','call_center_queues', 0)) {
|
||||
message::add($text['message-maximum_queues'].' '.$settings->get('limit','call_center_queues', ''), 'negative');
|
||||
header('Location: call_center_queues.php');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if (!empty($action) && is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
|
||||
switch ($action) {
|
||||
@@ -144,11 +159,11 @@
|
||||
echo button::create(['type'=>'button','label'=>$text['button-wallboard'],'icon'=>'th','link'=>PROJECT_PATH.'/app/call_center_wallboard/call_center_wallboard.php']);
|
||||
}
|
||||
$margin_left = permission_exists('call_center_agent_view') || permission_exists('call_center_wallboard') ? 'margin-left: 15px;' : null;
|
||||
if (permission_exists('call_center_queue_add') && (!is_numeric($settings->get('limit', 'call_center_queues') ?? '') || $num_rows <= $settings->get('limit', 'call_center_queues'))) {
|
||||
if (permission_exists('call_center_queue_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','style'=>$margin_left,'link'=>'call_center_queue_edit.php']);
|
||||
unset($margin_left);
|
||||
}
|
||||
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($settings->get('limit', 'call_center_queues') ?? '') || $num_rows <= $settings->get('limit', 'call_center_queues'))) {
|
||||
if (permission_exists('call_center_queue_add') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$settings->get('theme', 'button_icon_copy'),'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none; '.!empty($margin_left),'onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
@@ -176,7 +191,7 @@
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($settings->get('limit', 'call_center_queues') ?? '') || $num_rows <= $settings->get('limit', 'call_center_queues'))) {
|
||||
if (permission_exists('call_center_queue_add') && $result) {
|
||||
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
|
||||
}
|
||||
if (permission_exists('call_center_queue_delete') && $result) {
|
||||
|
||||
@@ -326,7 +326,7 @@
|
||||
echo button::create(['type'=>'button','label'=>$text['button-profiles'],'icon'=>'clone','link'=>'device_profiles.php']);
|
||||
}
|
||||
$margin_left = permission_exists('device_import') || permission_exists('device_export') || permission_exists('device_vendor_view') || permission_exists('device_profile_view') ? "margin-left: 15px;" : null;
|
||||
if (permission_exists('device_add') && (empty($settings->get('limit', 'devices')) || ($total_devices < $settings->get('limit', 'devices')))) {
|
||||
if (permission_exists('device_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','style'=>$margin_left,'link'=>'device_edit.php']);
|
||||
unset($margin_left);
|
||||
}
|
||||
|
||||
@@ -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-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -292,7 +292,7 @@
|
||||
echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$settings->get('theme', 'button_icon_export'),'link'=>'extension_download.php']);
|
||||
}
|
||||
$margin_left = permission_exists('extension_import') || permission_exists('extension_export') ? "margin-left: 15px;" : null;
|
||||
if (permission_exists('extension_add') && (empty($settings->get('limit', 'extensions', 0)) || $total_extensions < $settings->get('limit', 'extensions'))) {
|
||||
if (permission_exists('extension_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','style'=>($margin_left ?? ''),'link'=>'extension_edit.php']);
|
||||
unset($margin_left);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,20 @@
|
||||
$gateways = $_POST['gateways'] ?? '';
|
||||
}
|
||||
|
||||
//get total gateway count from the database, check limit, if defined
|
||||
if (!empty($action) && $action == 'copy' && !empty($settings->get('limit', 'gateways'))) {
|
||||
$sql = "select count(gateway_uuid) from v_gateways ";
|
||||
$sql .= "where (domain_uuid = :domain_uuid ".(permission_exists('gateway_domain') ? " or domain_uuid is null " : null).") ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$total_gateways = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
if ($total_gateways >= $settings->get('limit', 'gateways')) {
|
||||
message::add($text['message-maximum_gateways'].' '.$settings->get('limit', 'gateways'), 'negative');
|
||||
header('Location: gateways.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if (!empty($action) && !empty($gateways)) {
|
||||
switch ($action) {
|
||||
|
||||
@@ -51,6 +51,20 @@
|
||||
$ivr_menus = $_POST['ivr_menus'];
|
||||
}
|
||||
|
||||
//get total ivr menu count from the database, check limit, if defined
|
||||
if (!empty($settings->get('limit', 'ivr_menus'))) {
|
||||
$sql = "select count(*) as num_rows from v_ivr_menus where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$total_ivr_menus = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if ($action == 'copy' && $total_ivr_menus >= $settings->get('limit', 'ivr_menus')) {
|
||||
message::add($text['message-maximum_ivr_menus'].' '.$settings->get('limit', 'ivr_menus'), 'negative');
|
||||
header('Location: ivr_menus.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if (!empty($action) && is_array($ivr_menus) && @sizeof($ivr_menus) != 0) {
|
||||
switch ($action) {
|
||||
@@ -163,10 +177,10 @@
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-ivr_menus']."</b><div class='count'>".number_format($num_rows)."</div></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('ivr_menu_add') && (empty($settings->get('limit', 'ivr_menus')) || $num_rows < $settings->get('limit', 'ivr_menus'))) {
|
||||
if (permission_exists('ivr_menu_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','link'=>'ivr_menu_edit.php']);
|
||||
}
|
||||
if (permission_exists('ivr_menu_add') && $ivr_menus && (empty($settings->get('limit', 'ivr_menus')) || $num_rows < $settings->get('limit', 'ivr_menus'))) {
|
||||
if (permission_exists('ivr_menu_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$settings->get('theme', 'button_icon_copy'),'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
||||
}
|
||||
if (permission_exists('ivr_menu_edit') && $ivr_menus) {
|
||||
|
||||
@@ -53,6 +53,21 @@
|
||||
$ring_groups = $_POST['ring_groups'];
|
||||
}
|
||||
|
||||
//get total ring group count from the database, check limit, if defined
|
||||
if (!empty($action) && $action == 'copy' && $settings->get('limit', 'ring_groups', '') ?? '') {
|
||||
$sql = "select count(*) from v_ring_groups ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$total_ring_groups = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if (is_numeric($settings->get('limit', 'ring_groups', '')) && $total_ring_groups >= $settings->get('limit', 'ring_groups', '')) {
|
||||
message::add($text['message-maximum_ring_groups'].' '.$settings->get('limit', 'ring_groups', ''), 'negative');
|
||||
header('Location: ring_groups.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if (!empty($action) && !empty($ring_groups)) {
|
||||
switch ($action) {
|
||||
@@ -180,10 +195,10 @@
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['title-ring_groups']."</b><div class='count'>".number_format($num_rows)."</div></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('ring_group_add') && (empty($settings->get('limit', 'ring_groups', 0)) || ($total_ring_groups < $settings->get('limit', 'ring_groups')))) {
|
||||
if (permission_exists('ring_group_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','link'=>'ring_group_edit.php']);
|
||||
}
|
||||
if (permission_exists('ring_group_add') && $ring_groups && (empty($settings->get('limit', 'ring_groups', 0)) || ($total_ring_groups < $settings->get('limit', 'ring_groups')))) {
|
||||
if (permission_exists('ring_group_add') && $ring_groups) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$settings->get('theme', 'button_icon_copy'),'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none;','onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
||||
}
|
||||
if (permission_exists('ring_group_edit') && $ring_groups) {
|
||||
@@ -212,7 +227,7 @@
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
if (permission_exists('ring_group_add') && $ring_groups && (empty($settings->get('limit', 'ring_groups', 0)) || ($total_ring_groups < $settings->get('limit', 'ring_groups')))) {
|
||||
if (permission_exists('ring_group_add') && $ring_groups) {
|
||||
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
|
||||
}
|
||||
if (permission_exists('ring_group_edit') && $ring_groups) {
|
||||
|
||||
@@ -216,6 +216,33 @@ $text['message-greeting_created']['zh-cn'] = "问候已创建";
|
||||
$text['message-greeting_created']['ja-jp'] = "挨拶が作成されました";
|
||||
$text['message-greeting_created']['ko-kr'] = "인사말이 생성되었습니다";
|
||||
|
||||
$text['message-maximum_voicemail_greetings']['en-us'] = "Maximum Voicemail Greetings:";
|
||||
$text['message-maximum_voicemail_greetings']['en-gb'] = "Maximum Voicemail Greetings:";
|
||||
$text['message-maximum_voicemail_greetings']['ar-eg'] = "الترحيبات الأقصى للمصوات المرئية:";
|
||||
$text['message-maximum_voicemail_greetings']['de-at'] = "Maximale Anrufbeantworter-Begrüßungen:";
|
||||
$text['message-maximum_voicemail_greetings']['de-ch'] = "Maximale Anrufbeantworter-Begrüßungen:";
|
||||
$text['message-maximum_voicemail_greetings']['de-de'] = "Maximale Anrufbeantworter-Begrüßungen:";
|
||||
$text['message-maximum_voicemail_greetings']['el-gr'] = "Μέγιστες Καλωσήρχεστε στον υπεύθυνο κλήσημα:";
|
||||
$text['message-maximum_voicemail_greetings']['es-cl'] = "Saludos Máximos de Correo de Voz:";
|
||||
$text['message-maximum_voicemail_greetings']['es-mx'] = "Saludos Máximos de Correo de Voz:";
|
||||
$text['message-maximum_voicemail_greetings']['fr-ca'] = "Messages accueillants max pour messagerie vocale:";
|
||||
$text['message-maximum_voicemail_greetings']['fr-fr'] = "Messages accueillants max pour messagerie vocale:";
|
||||
$text['message-maximum_voicemail_greetings']['he-il'] = "ברותחן קוליות מקסימליים:";
|
||||
$text['message-maximum_voicemail_greetings']['it-it'] = "Saluti di Voicemail Massimi:";
|
||||
$text['message-maximum_voicemail_greetings']['ka-ge'] = "აკმაყსი ტელეფონური პასხის გრეეტინგები:";
|
||||
$text['message-maximum_voicemail_greetings']['nl-nl'] = "Maximale Voicemail Groetjes:";
|
||||
$text['message-maximum_voicemail_greetings']['pl-pl'] = "Maksymalne powitania poczty głosowej:";
|
||||
$text['message-maximum_voicemail_greetings']['pt-br'] = "Cumprimentos Máximos da Caixa Postal de Voz:";
|
||||
$text['message-maximum_voicemail_greetings']['pt-pt'] = "Cumprimentos Máximos da Mensagem de Voz:";
|
||||
$text['message-maximum_voicemail_greetings']['ro-ro'] = "Salutări maxime pentru mesajele vocale:";
|
||||
$text['message-maximum_voicemail_greetings']['ru-ru'] = "Максимальное количество приветственных сообщений голосовой почты:";
|
||||
$text['message-maximum_voicemail_greetings']['sv-se'] = "Maximalt antal hälsningsmeddelanden för röstbrevlåda:";
|
||||
$text['message-maximum_voicemail_greetings']['uk-ua'] = "Максимальна кількість привітань голосової пошти:";
|
||||
$text['message-maximum_voicemail_greetings']['tr-tr'] = "Maksimum Sesli Mesaj Selamlamaları:";
|
||||
$text['message-maximum_voicemail_greetings']['zh-cn'] = "最大语音留言问候数:";
|
||||
$text['message-maximum_voicemail_greetings']['ja-jp'] = "ボイスメールの最大挨拶数:";
|
||||
$text['message-maximum_voicemail_greetings']['ko-kr'] = "최대 음성메일 인사말 수:";
|
||||
|
||||
$text['label-tools']['en-us'] = "Tools";
|
||||
$text['label-tools']['en-gb'] = "Tools";
|
||||
$text['label-tools']['ar-eg'] = "أدوات";
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
$order = $_GET["order"] ?? '';
|
||||
|
||||
//set the back button url
|
||||
$_SESSION['back'][$_SERVER['PHP_SELF']] = !empty($_GET['back']) ? urldecode($_GET['back']) : $_SESSION['back'][$_SERVER['PHP_SELF']];
|
||||
$_SESSION['back'][$_SERVER['PHP_SELF']] = !empty($_GET['back']) ? urldecode($_GET['back']) : $_SESSION['back'][$_SERVER['PHP_SELF']] ?? '';
|
||||
|
||||
//define order by default
|
||||
if ($order_by == '') {
|
||||
@@ -158,6 +158,13 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//greeting limit
|
||||
if (!empty($_POST['limit_reached']) && $_POST['limit_reached'] == 'true'){
|
||||
message::add($text['message-maximum_voicemail_greetings'].' 9', 'negative');
|
||||
header('Location: voicemail_greetings.php?id='.urlencode($voicemail_id));
|
||||
exit;
|
||||
}
|
||||
|
||||
//upload the greeting
|
||||
if (!empty($_POST['a']) && $_POST['a'] == "upload" && permission_exists('voicemail_greeting_upload')
|
||||
&& $_POST['type'] == 'rec' && is_uploaded_file($_FILES['file']['tmp_name'])) {
|
||||
@@ -182,12 +189,12 @@
|
||||
|
||||
//find the next available greeting id starting at 1
|
||||
$greeting_id = 1;
|
||||
while (true) {
|
||||
for ($i = 1; $i <= 9; $i++) {
|
||||
$found_existing_file = false;
|
||||
|
||||
//check for wav, mp3, and ogg files with the current greeting id
|
||||
foreach ($allowed_extensions as $extension) {
|
||||
$potential_file_name = "greeting_{$greeting_id}.{$extension}";
|
||||
$potential_file_name = "greeting_{$i}.{$extension}";
|
||||
if (file_exists($greeting_dir . '/' . $potential_file_name)) {
|
||||
$found_existing_file = true;
|
||||
break;
|
||||
@@ -195,10 +202,10 @@
|
||||
}
|
||||
|
||||
if (!$found_existing_file) {
|
||||
//found an available greeting id
|
||||
$greeting_id = $i;
|
||||
break;
|
||||
}
|
||||
|
||||
$greeting_id++;
|
||||
}
|
||||
|
||||
//set the greeting file name
|
||||
@@ -363,24 +370,31 @@
|
||||
echo " <div class='actions'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$settings->get('theme', 'button_icon_back'),'id'=>'btn_back','link'=>$_SESSION['back'][$_SERVER['PHP_SELF']]]);
|
||||
$margin_left = false;
|
||||
if (permission_exists('voicemail_greeting_add') && is_array($greetings) && @sizeof($greetings) < 9 && $speech_enabled == 'true') {
|
||||
if (permission_exists('voicemail_greeting_add') && is_array($greetings) && $speech_enabled == 'true') {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','style'=>'margin-left: 15px;','link'=>'voicemail_greeting_edit.php?voicemail_id='.urlencode($voicemail_id)]);
|
||||
$margin_left = true;
|
||||
}
|
||||
if (permission_exists('voicemail_greeting_upload') && is_array($greetings) && @sizeof($greetings) < 9) {
|
||||
echo "<form id='form_upload' class='inline' method='post' enctype='multipart/form-data'>\n";
|
||||
echo "<input name='a' type='hidden' value='upload'>\n";
|
||||
echo "<input type='hidden' name='id' value='".escape($voicemail_id)."'>\n";
|
||||
echo "<input type='hidden' name='type' value='rec'>\n";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo " <form id='form_upload' class='inline' method='post' enctype='multipart/form-data'>\n";
|
||||
echo " <input name='a' type='hidden' value='upload'>\n";
|
||||
echo " <input type='hidden' name='id' value='".escape($voicemail_id)."'>\n";
|
||||
echo " <input type='hidden' name='type' value='rec'>\n";
|
||||
echo " <input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
echo button::create(['type'=>'button','label'=>$text['button-upload'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_upload','style'=>(!$margin_left ? 'margin-left: 15px;' : null),'onclick'=>"$(this).fadeOut(250, function(){ $('span#form_upload').fadeIn(250); document.getElementById('ulfile').click(); });"]);
|
||||
echo "<span id='form_upload' style='display: none;'>";
|
||||
echo " <span id='form_upload' style='display: none;'>";
|
||||
echo button::create(['label'=>$text['button-cancel'],'icon'=>$settings->get('theme', 'button_icon_cancel'),'type'=>'button','id'=>'btn_upload_cancel','style'=>'margin-left: 15px;','onclick'=>"$('span#form_upload').fadeOut(250, function(){ document.getElementById('form_upload').reset(); $('#btn_upload').fadeIn(250) });"]);
|
||||
echo "<input type='text' class='txt' style='width: 100px; cursor: pointer;' id='filename' placeholder='Select...' onclick=\"document.getElementById('ulfile').click(); this.blur();\" onfocus='this.blur();'>";
|
||||
echo "<input type='file' id='ulfile' name='file' style='display: none;' accept='.wav,.mp3,.ogg' onchange=\"document.getElementById('filename').value = this.files.item(0).name; check_file_type(this);\">";
|
||||
echo " <input type='text' class='txt' style='width: 100px; cursor: pointer;' id='filename' placeholder='Select...' onclick=\"document.getElementById('ulfile').click(); this.blur();\" onfocus='this.blur();'>";
|
||||
echo " <input type='file' id='ulfile' name='file' style='display: none;' accept='.wav,.mp3,.ogg' onchange=\"document.getElementById('filename').value = this.files.item(0).name; check_file_type(this);\">";
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-upload'],'icon'=>$settings->get('theme', 'button_icon_upload')]);
|
||||
echo "</span>\n";
|
||||
echo "</form>";
|
||||
echo " </span>\n";
|
||||
echo " </form>\n";
|
||||
$margin_left = true;
|
||||
}
|
||||
else if (permission_exists('voicemail_greeting_upload') && is_array($greetings) && @sizeof($greetings) >= 9) {
|
||||
echo " <form class='inline' method='post'>\n";
|
||||
echo " <input type='hidden' name='limit_reached' value='true'>\n";
|
||||
echo button::create(['type'=>'submit','label'=>$text['button-upload'],'icon'=>$settings->get('theme', 'button_icon_add')]);
|
||||
echo " </form>\n";
|
||||
$margin_left = true;
|
||||
}
|
||||
if (permission_exists('voicemail_greeting_delete') && $greetings) {
|
||||
|
||||
@@ -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-2024
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2025
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -46,6 +46,22 @@
|
||||
$users = $_POST['users'] ?? '';
|
||||
}
|
||||
|
||||
//get total user count from the database, check limit, if defined
|
||||
if (permission_exists('user_add') && !empty($action) && $action == 'copy' && !empty($settings->get('limit', 'users'))) {
|
||||
$sql = "select count(*) ";
|
||||
$sql .= "from v_users ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if ($num_rows >= $settings->get('limit', 'users')) {
|
||||
message::add($text['message-maximum_users'].' '.$settings->get('limit', 'users'), 'negative');
|
||||
header('Location: users.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if (!empty($action) && is_array($users) && @sizeof($users) != 0) {
|
||||
switch ($action) {
|
||||
|
||||
Reference in New Issue
Block a user