Fixed an issue that allowed some disabled module content to be visible or accessible.
This commit is contained in:
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
use api\classes\API_companies;
|
use api\classes\API_companies;
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['customers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_companies.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_companies.php';
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
use api\classes\API_office_stompjes;
|
use api\classes\API_office_stompjes;
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['office']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_office_stompjes.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_office_stompjes.php';
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
use api\classes\API_servers;
|
use api\classes\API_servers;
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['servers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_servers.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_servers.php';
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
if (!defined('APP_INIT')) {
|
if (!defined('APP_INIT')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['customers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_GET['view'])) {
|
if (isset($_GET['view'])) {
|
||||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/customers/pageCompanies_company_view.php');
|
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/customers/pageCompanies_company_view.php');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
if (!defined('APP_INIT')) {
|
if (!defined('APP_INIT')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['customers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
# IDE Section
|
# IDE Section
|
||||||
|
|
||||||
# Includes Section
|
# Includes Section
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ if (!defined('APP_INIT')) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['customers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
# IDE Section
|
# IDE Section
|
||||||
|
|
||||||
# Includes Section
|
# Includes Section
|
||||||
@@ -26,8 +30,8 @@ $jsScriptLoadData['datatables'] = true;
|
|||||||
$jsScriptLoadData['multiFilterSelect'] = true;
|
$jsScriptLoadData['multiFilterSelect'] = true;
|
||||||
$jsScriptLoadData['datepicker'] = true;
|
$jsScriptLoadData['datepicker'] = true;
|
||||||
$jsScriptLoadData['activateCompany'] = true;
|
$jsScriptLoadData['activateCompany'] = true;
|
||||||
# PageClasses Setup
|
|
||||||
|
|
||||||
|
# PageClasses Setup
|
||||||
|
|
||||||
# Retrieve Information for the page
|
# Retrieve Information for the page
|
||||||
if (!isset($_GET['all'])) {
|
if (!isset($_GET['all'])) {
|
||||||
@@ -66,9 +70,8 @@ while ($row = $stmt->fetch_assoc()) {
|
|||||||
<i class="fa-solid fa-filter"></i> <?php echo __('show_active') ?>
|
<i class="fa-solid fa-filter"></i> <?php echo __('show_active') ?>
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="/api/v1/customers/companies/sync/">
|
<form method="post" action="/api/v1/sources/inserve/sync-companies/">
|
||||||
<input type="hidden">
|
<input type="hidden">
|
||||||
<div class="col-lg-auto col-md-auto col-sm-auto">
|
<div class="col-lg-auto col-md-auto col-sm-auto">
|
||||||
<button class="btn btn-primary">
|
<button class="btn btn-primary">
|
||||||
@@ -89,7 +92,9 @@ while ($row = $stmt->fetch_assoc()) {
|
|||||||
<th><?php echo __('company_id') ?></th>
|
<th><?php echo __('company_id') ?></th>
|
||||||
<th><?php echo __('company_debtor') ?></th>
|
<th><?php echo __('company_debtor') ?></th>
|
||||||
<th><?php echo __('company_state') ?></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>
|
<th><?php echo __('actions') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -99,7 +104,9 @@ while ($row = $stmt->fetch_assoc()) {
|
|||||||
<th><?php echo __('company_id') ?></th>
|
<th><?php echo __('company_id') ?></th>
|
||||||
<th><?php echo __('company_debtor') ?></th>
|
<th><?php echo __('company_debtor') ?></th>
|
||||||
<th><?php echo __('company_state') ?></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>
|
<th><?php echo __('actions') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</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_id'] ?></td>
|
||||||
<td class="text-nowrap"><?php echo $company['company_source_id2'] ?></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['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>
|
<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>
|
<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) { ?>
|
<?php if ($API->checkPermissions('customer-companies', 'RW', true) && $company['server_count'] == 0) { ?>
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ use api\classes\API;
|
|||||||
if (!defined('APP_INIT')) {
|
if (!defined('APP_INIT')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['office']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
# IDE Section
|
# IDE Section
|
||||||
|
|
||||||
# Includes Section
|
# Includes Section
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
if (!defined('APP_INIT')) {
|
if (!defined('APP_INIT')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['servers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_GET['view'])) {
|
if (isset($_GET['view'])) {
|
||||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/servers/pageServerOverview_server_view.php');
|
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/servers/pageServerOverview_server_view.php');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ use bin\php\Classes\pageNavbar;
|
|||||||
if (!defined('APP_INIT')) {
|
if (!defined('APP_INIT')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['servers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
# IDE Section
|
# IDE Section
|
||||||
|
|
||||||
# Includes Section
|
# Includes Section
|
||||||
@@ -37,10 +42,12 @@ $stmt->execute();
|
|||||||
$result = $stmt->get_result();
|
$result = $stmt->get_result();
|
||||||
$server_data = $result->fetch_assoc();
|
$server_data = $result->fetch_assoc();
|
||||||
|
|
||||||
$companies_data = $GLOBALS['conn']->query("SELECT company_uuid, company_name FROM companies WHERE company_state = 'active'");
|
if ($GLOBALS['modules_enabled']['customers']) {
|
||||||
$companies = array();
|
$companies_data = $GLOBALS['conn']->query("SELECT company_uuid, company_name FROM companies WHERE company_state = 'active'");
|
||||||
while ($company_data = $companies_data->fetch_assoc()) {
|
$companies = array();
|
||||||
array_push($companies, $company_data);
|
while ($company_data = $companies_data->fetch_assoc()) {
|
||||||
|
array_push($companies, $company_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Retrieve Information for the page
|
# Retrieve Information for the page
|
||||||
@@ -194,36 +201,37 @@ $pageNavbar->outPutNavbar();
|
|||||||
</h4>
|
</h4>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<?php if ($GLOBALS['modules_enabled']['customers']) { ?>
|
||||||
<td>
|
<tr>
|
||||||
<h4>
|
<td>
|
||||||
<i class="fas fa-building"></i> <?php echo __('company') ?>
|
|
||||||
</h4>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php if ($API->checkPermissions('servers', 'RW', true)) { ?>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="input-group">
|
|
||||||
<select id="company_uuid" name="company_uuid" class="form-control">
|
|
||||||
<option></option>
|
|
||||||
<?php foreach ($companies as $company) { ?>
|
|
||||||
<option <?php echo ($server_data['company_uuid'] == $company['company_uuid']) ? 'selected' : '' ?> value="<?php echo $company['company_uuid'] ?>"><?php echo $company['company_name'] ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php } else { ?>
|
|
||||||
<h4>
|
<h4>
|
||||||
<?php
|
<i class="fas fa-building"></i> <?php echo __('company') ?>
|
||||||
$companyMap = array_column($companies, 'company_name', 'company_uuid');
|
|
||||||
echo $companyMap[$server_data['company_uuid']] ?? null;
|
|
||||||
?>
|
|
||||||
</h4>
|
</h4>
|
||||||
<?php } ?>
|
</td>
|
||||||
</td>
|
<td>
|
||||||
</tr>
|
<?php if ($API->checkPermissions('servers', 'RW', true)) { ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<select id="company_uuid" name="company_uuid" class="form-control">
|
||||||
|
<option></option>
|
||||||
|
<?php foreach ($companies as $company) { ?>
|
||||||
|
<option <?php echo ($server_data['company_uuid'] == $company['company_uuid']) ? 'selected' : '' ?> value="<?php echo $company['company_uuid'] ?>"><?php echo $company['company_name'] ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php } else { ?>
|
||||||
|
<h4>
|
||||||
|
<?php
|
||||||
|
$companyMap = array_column($companies, 'company_name', 'company_uuid');
|
||||||
|
echo $companyMap[$server_data['company_uuid']] ?? null;
|
||||||
|
?>
|
||||||
|
</h4>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<h4>
|
<h4>
|
||||||
|
|||||||
@@ -5,6 +5,11 @@ use api\classes\API;
|
|||||||
if (!defined('APP_INIT')) {
|
if (!defined('APP_INIT')) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$GLOBALS['modules_enabled']['servers']) {
|
||||||
|
echo '405 Not Allowed';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
# IDE Section
|
# IDE Section
|
||||||
|
|
||||||
# Includes Section
|
# Includes Section
|
||||||
|
|||||||
Reference in New Issue
Block a user