Fixed an issue that allowed some disabled module content to be visible or accessible.

This commit is contained in:
2026-01-07 23:16:36 +01:00
parent 604d71e0e6
commit eb2e4678eb
10 changed files with 97 additions and 37 deletions

View File

@@ -3,6 +3,10 @@ if (!defined('APP_INIT')) {
exit;
}
if (!$GLOBALS['modules_enabled']['customers']) {
echo '405 Not Allowed';
exit;
}
# IDE Section
# Includes Section
@@ -26,8 +30,8 @@ $jsScriptLoadData['datatables'] = true;
$jsScriptLoadData['multiFilterSelect'] = true;
$jsScriptLoadData['datepicker'] = true;
$jsScriptLoadData['activateCompany'] = true;
# PageClasses Setup
# PageClasses Setup
# Retrieve Information for the page
if (!isset($_GET['all'])) {
@@ -66,9 +70,8 @@ while ($row = $stmt->fetch_assoc()) {
<i class="fa-solid fa-filter"></i> &nbsp; <?php echo __('show_active') ?>
</a>
<?php } ?>
</div> &nbsp;
<form method="post" action="/api/v1/customers/companies/sync/">
<form method="post" action="/api/v1/sources/inserve/sync-companies/">
<input type="hidden">
<div class="col-lg-auto col-md-auto col-sm-auto">
<button class="btn btn-primary">
@@ -89,7 +92,9 @@ while ($row = $stmt->fetch_assoc()) {
<th><?php echo __('company_id') ?></th>
<th><?php echo __('company_debtor') ?></th>
<th><?php echo __('company_state') ?></th>
<th><?php echo __('server_count') ?></th>
<?php if ($GLOBALS['modules_enabled']['servers']) { ?>
<th><?php echo __('server_count') ?></th>
<?php } ?>
<th><?php echo __('actions') ?></th>
</tr>
</thead>
@@ -99,7 +104,9 @@ while ($row = $stmt->fetch_assoc()) {
<th><?php echo __('company_id') ?></th>
<th><?php echo __('company_debtor') ?></th>
<th><?php echo __('company_state') ?></th>
<th><?php echo __('server_count') ?></th>
<?php if ($GLOBALS['modules_enabled']['servers']) { ?>
<th><?php echo __('server_count') ?></th>
<?php } ?>
<th><?php echo __('actions') ?></th>
</tr>
</tfoot>
@@ -111,7 +118,9 @@ while ($row = $stmt->fetch_assoc()) {
<td class="text-nowrap"><?php echo $company['company_source_id'] ?></td>
<td class="text-nowrap"><?php echo $company['company_source_id2'] ?></td>
<td class="text-nowrap"><?php echo $company['company_state'] ?></td>
<td class="text-nowrap"><?php echo $company['server_count'] ?></td>
<?php if ($GLOBALS['modules_enabled']['servers']) { ?>
<td class="text-nowrap"><?php echo $company['server_count'] ?></td>
<?php } ?>
<td>
<a href="/companies?view=<?php echo $company['company_uuid'] ?>" class="btn btn-info btn-sm btn-rounded" data-item-uuid="<?php echo $company['company_uuid'] ?>"><i class="fa-solid fa-eye"></i></a>
<?php if ($API->checkPermissions('customer-companies', 'RW', true) && $company['server_count'] == 0) { ?>