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:
Alex
2025-12-26 17:08:14 -07:00
committed by GitHub
parent 2373b45515
commit e0f62aa5b9
9 changed files with 144 additions and 29 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-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) {