A lot of code cleanup and code sanitation done.
This commit is contained in:
@@ -3,11 +3,11 @@ if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
}
|
||||
if (isset($_GET['add'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageDevices_add.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageDevices_add.php";
|
||||
} elseif (isset($_GET['edit'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageDevices_edit.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageDevices_edit.php";
|
||||
} elseif (isset($_GET['view'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageDevices_view.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageDevices_view.php";
|
||||
} else {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageDevices_list.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageDevices_list.php";
|
||||
}
|
||||
@@ -10,10 +10,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_devices.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_devices.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -145,7 +145,7 @@ $formBuilder->startForm();
|
||||
<label for="device_image" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('device_image') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<div class="input-file input-file-image">
|
||||
<img class="img-upload-preview" width="200" src="/src/images/placeholder500x500.png" alt="preview">
|
||||
<img class="img-upload-preview" width="200" src="/src/images/placeholder200x200.png" alt="preview">
|
||||
<input type="file" class="form-control form-control-file" id="device_image" name="device_image" accept="image/png">
|
||||
<label for="device_image" class="label-input-file btn btn-black btn-round">
|
||||
<span class="btn-label"><i class="fa fa-file-image"></i></span>
|
||||
|
||||
@@ -10,10 +10,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_devices.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_devices.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -9,9 +9,9 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_devices.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_devices.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -79,7 +79,7 @@ $pageNavbar->outPutNavbar();
|
||||
<tbody>
|
||||
<?php while ($row = $data->fetch_assoc()) { ?>
|
||||
<tr data-item-id="<?php echo $row['device_uuid']; ?>">
|
||||
<td style="padding-top: 0px!important;padding-bottom: 0px!important;">
|
||||
<td style="padding-top: 0!important;padding-bottom: 0!important;">
|
||||
<img class="img-upload-preview" src="data:image/png;base64, <?php echo $row['device_image_thumbnail'] ?>" alt="">
|
||||
</td>
|
||||
<td><?php echo ucfirst($row['device_type']) ?></td>
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
<?php
|
||||
|
||||
use api\classes\API;
|
||||
use bin\php\Classes\pageNavbar;
|
||||
|
||||
if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
}
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_devices.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_devices.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -18,7 +23,7 @@ if (!$API->checkPermissions('admin-devices', 'RO', true)) {
|
||||
}
|
||||
|
||||
# Page functions
|
||||
function showExtension($devicesLinked, $filter = false)
|
||||
function showExtension($devicesLinked, $filter = false): void
|
||||
{
|
||||
if (count($devicesLinked) > 0) {
|
||||
foreach ($devicesLinked as $extension) {
|
||||
@@ -34,7 +39,7 @@ function showExtension($devicesLinked, $filter = false)
|
||||
<?php }
|
||||
}
|
||||
|
||||
function makeFileTables($API, $dataFolder, $device_slugify)
|
||||
function makeFileTables($API, $dataFolder, $device_slugify): void
|
||||
{
|
||||
$device_data_dir = $_SERVER['DOCUMENT_ROOT'] . '/data/devices/' . $device_slugify . '/' . $dataFolder . '/';
|
||||
$documents = array_diff(scandir($device_data_dir), array('..', '.'));
|
||||
@@ -70,7 +75,7 @@ function makeFileTables($API, $dataFolder, $device_slugify)
|
||||
<?php }
|
||||
}
|
||||
|
||||
function render_template_controls($template_uuid, $device_uuid, $default_template, $platform_uuid)
|
||||
function render_template_controls($template_uuid, $device_uuid, $default_template, $platform_uuid): void
|
||||
{
|
||||
?>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
@@ -135,8 +140,8 @@ if ($device_data_result->num_rows == 0) {
|
||||
}
|
||||
|
||||
# Set breadcrumb data
|
||||
array_push($GLOBALS['breadCrumbArray'], array('display' => __('devices'), 'href' => '/devices/'));
|
||||
array_push($GLOBALS['breadCrumbArray'], array('display' => $device_data['vendor_name'] . ' ' . $device_data['device_name'], 'href' => '?view=' . $device_data['device_uuid']));
|
||||
$_SESSION['breadCrumbArray'][] = ['display' => __('devices'), 'href' => '/devices/'];
|
||||
$_SESSION['breadCrumbArray'][] = ['display' => $device_data['vendor_name'] . ' ' . $device_data['device_name'], 'href' => '?view=' . $device_data['device_uuid']];
|
||||
|
||||
# Start page output
|
||||
$pageNavbar->outPutNavbar();
|
||||
@@ -198,6 +203,7 @@ $pageNavbar->outPutNavbar();
|
||||
<tr>
|
||||
<td class="align-top">device_extra:</td>
|
||||
<td class="w-100">
|
||||
<label for="device_extra"></label>
|
||||
<textarea class="form-control" id="device_extra" name="device_extra" rows="5" disabled><?php echo json_encode(json_decode($device_data['device_extra']), JSON_PRETTY_PRINT) ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -213,7 +219,7 @@ $pageNavbar->outPutNavbar();
|
||||
<h4>Uses</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
To be made. Its going to be visible where the device is used (organisation/site).
|
||||
To be made. It's going to be visible where the device is used (organisation/site).
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -235,7 +241,7 @@ $pageNavbar->outPutNavbar();
|
||||
|
||||
$device_extensions = array();
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
array_push($device_extensions, $row['device_uuid']);
|
||||
$device_extensions[] = $row['device_uuid'];
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
@@ -252,7 +258,7 @@ $pageNavbar->outPutNavbar();
|
||||
$result = $stmt->get_result();
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
array_push($devicesLinked, $row);
|
||||
$devicesLinked[] = $row;
|
||||
}
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
}
|
||||
if (isset($_GET['add'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pagePlatforms_add.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pagePlatforms_add.php";
|
||||
} elseif (isset($_GET['edit'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pagePlatforms_edit.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pagePlatforms_edit.php";
|
||||
} else {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pagePlatforms_list.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pagePlatforms_list.php";
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
<?php
|
||||
|
||||
use api\classes\API;
|
||||
use bin\php\Classes\pageNavbar;
|
||||
use bin\php\Classes\formBuilder;
|
||||
|
||||
if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
}
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -11,10 +11,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_platforms.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_platforms.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -9,8 +9,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -3,9 +3,9 @@ if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
}
|
||||
if (isset($_GET['add'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageVendors_add.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageVendors_add.php";
|
||||
} elseif (isset($_GET['edit'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageVendors_edit.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageVendors_edit.php";
|
||||
} else {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/autop/pageVendors_list.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/autop/pageVendors_list.php";
|
||||
}
|
||||
@@ -10,10 +10,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_vendors.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_vendors.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -11,10 +11,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_vendors.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_vendors.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -58,14 +58,14 @@ if ($vendor_data) { ?>
|
||||
<input type="hidden" name="X-HTTP-Method-Override" value="PUT">
|
||||
<div class="card-body">
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="vendor_name" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('vendor_name') ?></label>
|
||||
<label for="vendor_name_edit" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('vendor_name') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="text" class="form-control" id="vendor_name_edit" name="vendor_name" placeholder="" value="<?php echo $vendor_data['vendor_name'] ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="vendor_slugify" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('vendor_slugify') ?></label>
|
||||
<label for="vendor_slugify_edit" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('vendor_slugify') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="text" class="form-control" id="vendor_slugify_edit" name="vendor_slugify" placeholder="" value="<?php echo $vendor_data['vendor_slugify'] ?>" required disabled>
|
||||
</div>
|
||||
|
||||
@@ -11,9 +11,9 @@ if (!defined('APP_INIT')) {
|
||||
// N/A
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_vendors.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_vendors.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -9,7 +9,7 @@ if (!$GLOBALS['modules_enabled']['customers']) {
|
||||
}
|
||||
|
||||
if (isset($_GET['view'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/customers/pageCompanies_company_view.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/customers/pageCompanies_company_view.php";
|
||||
} else {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/customers/pageCompanies_view.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/customers/pageCompanies_view.php";
|
||||
}
|
||||
@@ -15,9 +15,9 @@ if (!$GLOBALS['modules_enabled']['customers']) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/serverOverviewBuilder.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_servers.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/serverOverviewBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_servers.php";
|
||||
|
||||
# Check permissions
|
||||
$API_servers = new API_servers();
|
||||
|
||||
@@ -12,8 +12,8 @@ if (!$GLOBALS['modules_enabled']['customers']) {
|
||||
# Includes Section
|
||||
use api\classes\API;
|
||||
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_permissions.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_permissions.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use api\classes\API;
|
||||
use api\classes\API_office_stompjes;
|
||||
|
||||
if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
@@ -14,11 +14,10 @@ if (!$GLOBALS['modules_enabled']['office']) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_permissions.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_office_stompjes.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
$API = new API_office_stompjes();
|
||||
if (!$API->checkPermissions('office-stompjes', 'RO', true)) {
|
||||
echo 'error 401 unauthorized';
|
||||
exit;
|
||||
@@ -35,7 +34,6 @@ $jsScriptLoadData['datepicker'] = true;
|
||||
|
||||
# PageClasses Setup
|
||||
|
||||
|
||||
# Retrieve Information for the page
|
||||
$stmt = $GLOBALS['conn']->query("SELECT user_uuid, user_full_name, user_first_name, user_profile_picture_thumbnail, user_stompable, user_email FROM system_users WHERE user_stompable = '1'");
|
||||
$administrators = [];
|
||||
@@ -50,6 +48,7 @@ if (!isset($_GET['fd'])) {
|
||||
$date = str_replace('/', '-', htmlspecialchars($_GET['fd'], ENT_QUOTES, 'UTF-8'));
|
||||
$SelectFromDate = strtotime($date . ' 00:00:00');
|
||||
}
|
||||
|
||||
if (!isset($_GET['td'])) {
|
||||
$SelectTillDate = time();
|
||||
} else {
|
||||
@@ -72,24 +71,22 @@ foreach ($stompjes as $stompje) {
|
||||
</h2>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-end px-1">
|
||||
<div class="col-lg-auto col-md-auto col-sm-auto mt-sm-1 px-1">
|
||||
<label>
|
||||
<h5><?php echo __('from') ?>: </h5>
|
||||
</label>
|
||||
<div class="d-flex align-items-center gap-2 justify-content-end">
|
||||
<h5><?php echo __('from') ?>: </h5>
|
||||
</div>
|
||||
<div class="col-lg-auto col-md-auto col-sm-auto">
|
||||
<div class="input-group">
|
||||
<label for="fd"></label>
|
||||
<input type="text" id="fd" class="form-control" data-datepicker="true" value="<?php echo date('d/m/Y', $SelectFromDate) ?>"/>
|
||||
<span class="input-group-text"><i class="fa fa-calendar-check"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-auto col-md-auto col-sm-auto mt-sm-1 px-2">
|
||||
<label>
|
||||
<h5><?php echo __('to') ?>: </h5>
|
||||
</label>
|
||||
<h5><?php echo __('to') ?>: </h5>
|
||||
</div>
|
||||
<div class="col-lg-auto col-md-auto col-sm-auto px-2">
|
||||
<div class="input-group">
|
||||
<label for="td"></label>
|
||||
<input type="text" id="td" class="form-control" data-datepicker="true" value="<?php echo date('d/m/Y', $SelectTillDate) ?>"/>
|
||||
<span class="input-group-text"><i class="fa fa-calendar-check"></i></span>
|
||||
</div>
|
||||
|
||||
@@ -8,10 +8,10 @@ if (!defined('APP_INIT')) {
|
||||
# Includes Section
|
||||
use api\classes\API;
|
||||
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
$API = new API();
|
||||
|
||||
function showCard($module_name, $page_name, $width = 3)
|
||||
function showCard($module_name, $page_name): void
|
||||
{
|
||||
$page = $GLOBALS['pages'][$module_name][$page_name];
|
||||
?>
|
||||
@@ -40,11 +40,11 @@ function showCard($module_name, $page_name, $width = 3)
|
||||
<div class="row row-cols-1 row-cols-md-3 row-cols-sm-2 g-3">
|
||||
<?php
|
||||
if ($GLOBALS['modules_enabled']['customers'] && $API->checkPermissions('customer-companies', 'RO', true)) {
|
||||
showCard('customers', 'companies', '6');
|
||||
showCard('customers', 'companies');
|
||||
}
|
||||
|
||||
if ($GLOBALS['modules_enabled']['servers'] && $API->checkPermissions('servers', 'RO', true)) {
|
||||
showCard('servers', 'server_overview', '6');
|
||||
showCard('servers', 'server_overview');
|
||||
}
|
||||
|
||||
if ($GLOBALS['modules_enabled']['office'] && $API->checkPermissions('office-stompjes', 'RO', true)) {
|
||||
|
||||
@@ -3,7 +3,7 @@ if (!defined('APP_INIT')) {
|
||||
exit;
|
||||
}
|
||||
if (isset($_GET['edit'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/pageUserProfile_edit.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/pageUserProfile_edit.php";
|
||||
} else {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/pageUserProfile_view.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/pageUserProfile_view.php";
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
# Page functions
|
||||
|
||||
# JS Scripts to load for this page
|
||||
@@ -29,7 +29,7 @@ $user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups WH
|
||||
$user_groups = array();
|
||||
$user_data = false;
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ if ($user_data) {
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="user_email" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('user_email') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="email" class="form-control" id="user_email" name="user_email" value="<?php echo $user_data['user_email'] ?>" placeholder="user@example.xxx" required autofill="off" autocomplete="off"/>
|
||||
<input type="email" class="form-control" id="user_email" name="user_email" value="<?php echo $user_data['user_email'] ?>" placeholder="user@example.xxx" required autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_apitoken.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_apitoken.php";
|
||||
|
||||
# Check permissions
|
||||
|
||||
@@ -31,7 +31,7 @@ $user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups WH
|
||||
$user_groups = array();
|
||||
$admin_data = false;
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ if (isset($_SESSION['tmp_api_token'])) {
|
||||
|
||||
if ($API_token->checkPermissions('admin-access-admins', 'RW', true)) {
|
||||
$pageNavbar->AddHTMLButton('<a class="btn btn-primary mx-3" type="button" href="?edit=' . $_SESSION['user']['user_uuid'] . '"><i class="fas fa-edit"></i> ' . __('edit') . '</a>');
|
||||
};
|
||||
}
|
||||
|
||||
# Set breadcrumb data
|
||||
|
||||
@@ -242,7 +242,7 @@ if ($user_data) { ?>
|
||||
<h4 class="mb-0">User history</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
To be made. Its going show the history of the user.
|
||||
To be made. It's going show the history of the user.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -316,7 +316,7 @@ if ($user_data) { ?>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-api-data='<?php echo json_encode(['api_token_uuid' => $token_data['api_token_uuid'], 'api_token_revoked' => $token_data['api_token_revoked'] ? 1 : 0]) ?>' data-api-changevalue="api_token_revoked" data-api-url="/api/v1/user/apitoken/" <?php echo((($token_data['api_token_revoked'])) ? 'checked' : '') ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<?php if ($API_token->checkPermissions('user-apitoken-self', 'RW', true)) { ?>
|
||||
|
||||
@@ -9,11 +9,10 @@ if (!defined('APP_INIT')) {
|
||||
}
|
||||
# IDE Section
|
||||
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -41,7 +40,7 @@ $formBuilder = new formBuilder('add_admin', '<i class="fas fa-plus"></i>', '/acc
|
||||
$user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups WHERE user_group_type = 'admin' ORDER BY user_group_weight DESC");
|
||||
$user_groups = array();
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ $formBuilder->startForm();
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="user_email" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('user_email') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="email" class="form-control" id="user_email" name="user_email" placeholder="user@example.xxx" required autofill="off" autofocus autocomplete="off"/>
|
||||
<input type="email" class="form-control" id="user_email" name="user_email" placeholder="user@example.xxx" required autofocus autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -38,7 +38,7 @@ $user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups WH
|
||||
$user_groups = array();
|
||||
$admin_data = false;
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ if ($admin_data) {
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="user_email" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('user_email') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="email" class="form-control" id="user_email" name="user_email" value="<?php echo $admin_data['user_email'] ?>" placeholder="user@example.xxx" required autofill="off" autocomplete="off"/>
|
||||
<input type="email" class="form-control" id="user_email" name="user_email" value="<?php echo $admin_data['user_email'] ?>" placeholder="user@example.xxx" required autocomplete="off"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_apitoken.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_apitoken.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -45,7 +45,7 @@ $user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups WH
|
||||
$user_groups = array();
|
||||
$admin_data = false;
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ $_GET['user_uuid'] = $user_uuid;
|
||||
$userHashigherGroupWeight = false;
|
||||
if ($admin_data['user_group_weight'] > $_SESSION['user']['user_group_weight']) {
|
||||
$userHashigherGroupWeight = true;
|
||||
};
|
||||
}
|
||||
|
||||
$API_token = new API_apitoken();
|
||||
$requiredFields = ['user_uuid' => ['type' => 'uuid']];
|
||||
@@ -237,15 +237,16 @@ if ($admin_data) { ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if ($API->checkPermissions('admin-access-admins-resetpassword', 'RW', true)) { ?>
|
||||
<?php }
|
||||
if ($API->checkPermissions('admin-access-admins-resetpassword', 'RW', true)) { ?>
|
||||
<form method="post" action="/api/v1/user/resetpassword/">
|
||||
<input type="hidden" name="user_uuid" value="<?php echo $user_uuid ?>">
|
||||
<input type="hidden" name="user_uuid" value="<?= $user_uuid ?>">
|
||||
<button class="btn btn-primary mt-2">
|
||||
<i class="fa-solid fa-lock"></i> <?php echo __('send_password_reset') ?>
|
||||
<i class="fa-solid fa-lock"></i> <?= __('send_password_reset') ?>
|
||||
</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
reset the verified email (to be made)<br>
|
||||
</div>
|
||||
</div>
|
||||
@@ -304,7 +305,7 @@ if ($admin_data) { ?>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-api-data='<?php echo json_encode(['api_token_uuid' => $token_data['api_token_uuid'], 'api_token_revoked' => $token_data['api_token_revoked'] ? 1 : 0]) ?>' data-api-changevalue="api_token_revoked" data-api-url="/api/v1/user/apitoken/" <?php echo((($token_data['api_token_revoked'])) ? 'checked' : '') ?> <?php echo($userHashigherGroupWeight ? '' : 'disabled') ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<?php if ($API_token->checkPermissions('user-apitoken-others', 'RW', true)) { ?>
|
||||
@@ -329,7 +330,7 @@ if ($admin_data) { ?>
|
||||
<h4>User history</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
To be made. Its going show the history of the administrator.
|
||||
To be made. It's going show the history of the administrator.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,9 +10,9 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -36,7 +36,7 @@ $formBuilder = new formBuilder('add_permission', '<i class="fas fa-plus"></i>',
|
||||
$system_modules_data = $GLOBALS['conn']->query("SELECT * FROM system_modules WHERE module_enabled = 1");
|
||||
$system_modules = array();
|
||||
while ($module = $system_modules_data->fetch_assoc()) {
|
||||
array_push($system_modules, $module);
|
||||
$system_modules[] = $module;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_permissions.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_permissions.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -47,7 +47,7 @@ $permission_data = $API_permissions->getPermission()[0];
|
||||
$system_modules_data = $GLOBALS['conn']->query("SELECT * FROM system_modules WHERE module_enabled = 1");
|
||||
$system_modules = array();
|
||||
while ($module = $system_modules_data->fetch_assoc()) {
|
||||
array_push($system_modules, $module);
|
||||
$system_modules[] = $module;
|
||||
}
|
||||
|
||||
# Set breadcrumb data
|
||||
|
||||
@@ -10,9 +10,9 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_permissions.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_permissions.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -125,21 +125,21 @@ if ($permission_data) { ?>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-permission-uuid="<?= $permission_data_group['permission_uuid'] ?>" data-user-group-uuid="<?= $permission_data_group['user_group_uuid'] ?>" data-value="NA" data-api-url="/api/v1/portal-management/group-permissions/" <?php echo(($permission_data_group['permission_value'] == 'NA') ? 'checked' : '') ?>
|
||||
<?php echo ($API->checkPermissions('admin-access-control-permissions', 'RW', true)) ? '' : 'disabled' ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-permission-uuid="<?= $permission_data_group['permission_uuid'] ?>" data-user-group-uuid="<?= $permission_data_group['user_group_uuid'] ?>" data-value="RO" data-api-url="/api/v1/portal-management/group-permissions/" <?php echo(($permission_data_group['permission_value'] == 'RO') ? 'checked' : '') ?>
|
||||
<?php echo ($API->checkPermissions('admin-access-control-permissions', 'RW', true)) ? '' : 'disabled' ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-permission-uuid="<?= $permission_data_group['permission_uuid'] ?>" data-user-group-uuid="<?= $permission_data_group['user_group_uuid'] ?>" data-value="RW" data-api-url="/api/v1/portal-management/group-permissions/" <?php echo(($permission_data_group['permission_value'] == 'RW') ? 'checked' : '') ?>
|
||||
<?php echo ($API->checkPermissions('admin-access-control-permissions', 'RW', true)) ? '' : 'disabled' ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -10,9 +10,9 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -36,7 +36,7 @@ $formBuilder = new formBuilder('add_user_groups', '<i class="fas fa-plus"></i>',
|
||||
$user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups ORDER BY user_group_weight ASC");
|
||||
$user_groups = array();
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -80,7 +80,9 @@ $formBuilder->startForm();
|
||||
<label for="user_group_slugify" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('weight') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<div class="mb-3">
|
||||
<input type="number" class="form-control" name="user_group_weight" min="1" max="900" step="1" value="<?php echo $last_weight + 10 ?>">
|
||||
<label>
|
||||
<input type="number" class="form-control" name="user_group_weight" min="1" max="900" step="1" value="<?php echo $last_weight + 10 ?>">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,10 +11,10 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/formBuilder.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_usergroups.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/formBuilder.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_usergroups.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -87,7 +87,9 @@ $formBuilder->startForm();
|
||||
<label for="user_group_slugify" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('weight') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<div class="mb-3">
|
||||
<input type="number" class="form-control" name="user_group_weight" min="1" max="900" step="1" value="<?php echo $user_group['user_group_weight'] ?>">
|
||||
<label>
|
||||
<input type="number" class="form-control" name="user_group_weight" min="1" max="900" step="1" value="<?php echo $user_group['user_group_weight'] ?>">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,8 +9,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_usergroups.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_usergroups.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API_usergroups();
|
||||
@@ -145,42 +145,42 @@ $pageNavbar->outPutNavbar();
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-permission-uuid="<?= $group_permissions_data['permission_uuid'] ?>" data-user-group-uuid="<?= $group_permissions_data['user_group_uuid'] ?>" data-value="NA" data-api-url="/api/v1/portal-management/group-permissions/" <?php echo(($group_permissions_data['permission_value'] == 'NA') ? 'checked' : '') ?>
|
||||
<?php echo ($toggleDisabled) ? 'disabled' : '' ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-permission-uuid="<?= $group_permissions_data['permission_uuid'] ?>" data-user-group-uuid="<?= $group_permissions_data['user_group_uuid'] ?>" data-value="RO" data-api-url="/api/v1/portal-management/group-permissions/" <?php echo(($group_permissions_data['permission_value'] == 'RO') ? 'checked' : '') ?>
|
||||
<?php echo ($toggleDisabled) ? 'disabled' : '' ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input type="checkbox" class="checkbox" data-permission-uuid="<?= $group_permissions_data['permission_uuid'] ?>" data-user-group-uuid="<?= $group_permissions_data['user_group_uuid'] ?>" data-value="RW" data-api-url="/api/v1/portal-management/group-permissions/" <?php echo(($group_permissions_data['permission_value'] == 'RW') ? 'checked' : '') ?>
|
||||
<?php echo ($toggleDisabled) ? 'disabled' : '' ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="btn btn-info btn-sm btn-rounded" data-bs-toggle="modal" data-bs-target="#infoModal<?php echo $group_permissions_data['permission_uuid'] ?>"><i class="fa-solid fa-circle-info"></i></a>
|
||||
</td>
|
||||
<div class="modal fade" id="infoModal<?php echo $group_permissions_data['permission_uuid'] ?>" tabindex="-1" aria-labelledby="infoModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content bg-black2">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="infoModalLabel">
|
||||
<i class="fas fa-info-circle"></i> <?php echo __('information') ?>
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $group_permissions_data['permission_description'] ?>
|
||||
</div>
|
||||
</tr>
|
||||
<div class="modal fade" id="infoModal<?php echo $group_permissions_data['permission_uuid'] ?>" tabindex="-1" aria-labelledby="infoModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content bg-black2">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="infoModalLabel">
|
||||
<i class="fas fa-info-circle"></i> <?php echo __('information') ?>
|
||||
</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $group_permissions_data['permission_description'] ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</tr>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -8,8 +8,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_permissions.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_permissions.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -17,7 +17,7 @@ $API = new API();
|
||||
# Page functions
|
||||
|
||||
# JS Scripts to load for this page
|
||||
$jsScriptLoadData['activeTabOnRefresh'] = true;;
|
||||
$jsScriptLoadData['activeTabOnRefresh'] = true;
|
||||
$jsScriptLoadData['multiFilterSelect'] = true;
|
||||
$jsScriptLoadData['delete_confirmation'] = true;
|
||||
$jsScriptLoadData['datatables'] = true;
|
||||
@@ -28,7 +28,7 @@ $jsScriptLoadData['datatables'] = true;
|
||||
$user_groups_data = $GLOBALS['conn']->query("SELECT * FROM system_user_groups ORDER BY user_group_weight ASC");
|
||||
$user_groups = array();
|
||||
while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
array_push($user_groups, $user_group);
|
||||
$user_groups[] = $user_group;
|
||||
$last_weight = $user_group['user_group_weight'];
|
||||
}
|
||||
|
||||
@@ -36,21 +36,21 @@ while ($user_group = $user_groups_data->fetch_assoc()) {
|
||||
$stmt = $GLOBALS['conn']->query("SELECT * FROM system_users INNER JOIN system_user_groups ON system_users.user_group_uuid = system_user_groups.user_group_uuid WHERE user_group_type = 'admin'");
|
||||
$administrators = array();
|
||||
while ($row = $stmt->fetch_assoc()) {
|
||||
array_push($administrators, $row);
|
||||
$administrators[] = $row;
|
||||
}
|
||||
|
||||
|
||||
$stmt = $GLOBALS['conn']->query("SELECT * FROM system_permissions INNER JOIN system_modules ON system_permissions.module_uuid = system_modules.module_uuid WHERE system_modules.module_enabled = 1");
|
||||
$permissions = array();
|
||||
while ($row = $stmt->fetch_assoc()) {
|
||||
array_push($permissions, $row);
|
||||
$permissions[] = $row;
|
||||
}
|
||||
|
||||
# Set breadcrumb data
|
||||
|
||||
# Start page output
|
||||
?>
|
||||
<div class="card-body activeTabOnRefresh" style="opacity: 0; transition: opacity 10ms;">
|
||||
<div class="card-body activeTabOnRefresh">
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<div class="nav flex-column nav-pills nav-secondary nav-pills-no-bd nav-pills-icons" id="v-pills-tab-with-icon" role="tablist" aria-orientation="vertical">
|
||||
|
||||
@@ -12,7 +12,7 @@ $jsScriptLoadData['activeTabOnRefresh'] = true;
|
||||
<div class="nav flex-column nav-pills nav-secondary nav-pills-no-bd nav-pills-icons" id="v-pills-tab-with-icon" role="tablist" aria-orientation="vertical">
|
||||
|
||||
<a class="nav-link active" id="overview-tab" data-bs-toggle="pill" href="#overview" role="tab" aria-controls="overview" aria-selected="true">
|
||||
<i class="fa-solid fa-ear-listen"></i></i><?php echo __('overview'); ?>
|
||||
<i class="fa-solid fa-ear-listen"></i><?php echo __('overview'); ?>
|
||||
</a>
|
||||
<a class="nav-link" id="monitoring-tab" data-bs-toggle="pill" href="#monitoring" role="tab" aria-controls="monitoring">
|
||||
<i class="fa-solid fa-magnifying-glass"></i><?php echo __('monitoring'); ?>
|
||||
@@ -25,7 +25,7 @@ $jsScriptLoadData['activeTabOnRefresh'] = true;
|
||||
<div class="row mb-3">
|
||||
<div class="col-4">
|
||||
<h2>
|
||||
<i class="fa-solid fa-ear-listen"></i></i> <?php echo __('overview') ?>
|
||||
<i class="fa-solid fa-ear-listen"></i> <?php echo __('overview') ?>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ if (!defined('APP_INIT')) {
|
||||
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -30,7 +30,7 @@ $portal_settings = $GLOBALS['conn']->query("SELECT * FROM system_settings")->fet
|
||||
$system_modules_data = $GLOBALS['conn']->query("SELECT * FROM system_modules");
|
||||
$system_modules = array();
|
||||
while ($module = $system_modules_data->fetch_assoc()) {
|
||||
array_push($system_modules, $module);
|
||||
$system_modules[] = $module;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ while ($module = $system_modules_data->fetch_assoc()) {
|
||||
# Start page output
|
||||
|
||||
?>
|
||||
<div class="card-body activeTabOnRefresh" style="opacity: 0; transition: opacity 10ms;">
|
||||
<div class="card-body activeTabOnRefresh">
|
||||
<div class="row">
|
||||
<div class="col-md-1 col-lg-1">
|
||||
<div class="nav flex-column nav-pills nav-secondary nav-pills-no-bd nav-pills-icons" id="v-pills-tab-with-icon" role="tablist" aria-orientation="vertical">
|
||||
@@ -187,13 +187,17 @@ while ($module = $system_modules_data->fetch_assoc()) {
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="mail_from_address" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('mail_from_address') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="email" class="form-control" name="mail_from_address" value="<?php echo $portal_settings['mail_from_address'] ?>" placeholder="" required/>
|
||||
<label>
|
||||
<input type="email" class="form-control" name="mail_from_address" value="<?php echo $portal_settings['mail_from_address'] ?>" placeholder="" required/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group form-show-validation row">
|
||||
<label for="mail_smtp_host" class="col-lg-3 col-md-3 col-sm-4 mt-sm-2"><?php echo __('mail_smtp_host') ?></label>
|
||||
<div class="col-lg-9 col-md-12 col-sm-10">
|
||||
<input type="text" class="form-control" name="mail_smtp_host" value="<?php echo $portal_settings['mail_smtp_host'] ?>" placeholder="" required/>
|
||||
<label>
|
||||
<input type="text" class="form-control" name="mail_smtp_host" value="<?php echo $portal_settings['mail_smtp_host'] ?>" placeholder="" required/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -335,7 +339,7 @@ while ($module = $system_modules_data->fetch_assoc()) {
|
||||
<?php echo(($module['module_enabled']) ? 'checked' : '') ?>
|
||||
<?php echo ($API->checkPermissions('admin-modules', 'RW', true)) ? '' : 'disabled' ?>
|
||||
<?php echo(($module['module_slugify'] == 'system') ? 'disabled' : '') ?>>
|
||||
<div class="slider"></div>
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -9,8 +9,8 @@ if (!defined('APP_INIT')) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
|
||||
@@ -9,7 +9,7 @@ if (!$GLOBALS['modules_enabled']['servers']) {
|
||||
}
|
||||
|
||||
if (isset($_GET['view'])) {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/servers/pageServerOverview_server_view.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/servers/pageServerOverview_server_view.php";
|
||||
} else {
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/pages/servers/pageServerOverview_view.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/pages/servers/pageServerOverview_view.php";
|
||||
}
|
||||
@@ -14,8 +14,8 @@ if (!$GLOBALS['modules_enabled']['servers']) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/pageNavbar.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API.php';
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/pageNavbar.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
|
||||
|
||||
# Check permissions
|
||||
$API = new API();
|
||||
@@ -47,7 +47,7 @@ if ($GLOBALS['modules_enabled']['customers']) {
|
||||
$companies_data = $GLOBALS['conn']->query("SELECT company_uuid, company_name FROM companies WHERE company_state = 'active'");
|
||||
$companies = array();
|
||||
while ($company_data = $companies_data->fetch_assoc()) {
|
||||
array_push($companies, $company_data);
|
||||
$companies[] = $company_data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ if ($API->checkPermissions('servers', 'RW', true)) {
|
||||
) .
|
||||
'</form>'
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
# Set breadcrumb data
|
||||
$_SESSION['breadCrumbArray'][] = ['display' => __('server_overview'), 'href' => '/servers/'];
|
||||
@@ -150,12 +150,12 @@ $pageNavbar->outPutNavbar();
|
||||
<div class="row pb-5">
|
||||
<div class="col-md-3 col-lg-3">
|
||||
<h2><?php echo $server_data['server_os'] ?></h2>
|
||||
<img class="img-fluid os-logo" src="/src/images/os/<?php echo $logo ?>.svg">
|
||||
<img alt="os-logo" class="img-fluid os-logo" src="/src/images/os/<?php echo $logo ?>.svg">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-auto col-md-auto">
|
||||
<table class="table table-borderless">
|
||||
<form id="FormValidation" enctype="multipart/form-data" method="post" action="/api/v1/servers/">
|
||||
<form id="FormValidation" enctype="multipart/form-data" method="post" action="/api/v1/servers/">
|
||||
<table class="table table-borderless">
|
||||
<input type="hidden" name="X-HTTP-Method-Override" value="POST">
|
||||
<input type="hidden" name="_return" value="/servers?view=<?php echo $server_data['server_uuid'] ?>">
|
||||
<input type="hidden" name="server_vm_id" value="<?php echo $server_data['server_vm_id'] ?>"/>
|
||||
@@ -214,6 +214,7 @@ $pageNavbar->outPutNavbar();
|
||||
|
||||
|
||||
<div class="input-group">
|
||||
<label for="company_uuid"></label>
|
||||
<select id="company_uuid" name="company_uuid" class="form-control">
|
||||
<option></option>
|
||||
<?php foreach ($companies as $company) { ?>
|
||||
@@ -243,14 +244,14 @@ $pageNavbar->outPutNavbar();
|
||||
<?php if ($API->checkPermissions('servers', 'RW', true)) {
|
||||
if ($server_data['server_state'] != 'deleted') { ?>
|
||||
<div class="input-group">
|
||||
<select id="server_state" class="form-control" onchange="this.name = this.value ? 'server_state' : '';">
|
||||
<label for="server_state"></label>
|
||||
<select id="server_state" class="form-control">
|
||||
<option></option>
|
||||
<option <?php echo ($server_data['server_state'] == 'active') ? 'selected' : '' ?> value="active">Active</option>
|
||||
<option <?php echo ($server_data['server_state'] == 'trial') ? 'selected' : '' ?> value="trial">Trial</option>
|
||||
<option <?php echo ($server_data['server_state'] == 'disabled') ? 'selected' : '' ?> value="disabled">Disabled</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php } else { ?>
|
||||
<h4>
|
||||
<?php echo ucfirst($server_data['server_state']) ?>
|
||||
@@ -286,8 +287,8 @@ $pageNavbar->outPutNavbar();
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</form>
|
||||
</table>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ if (!$GLOBALS['modules_enabled']['servers']) {
|
||||
# IDE Section
|
||||
|
||||
# Includes Section
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/api/classes/API_servers.php';
|
||||
include_once($_SERVER['DOCUMENT_ROOT'] . '/bin/php/Classes/serverOverviewBuilder.php');
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API_servers.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/bin/php/Classes/serverOverviewBuilder.php";
|
||||
|
||||
# Check permissions
|
||||
$API_servers = new API_servers();
|
||||
@@ -64,5 +64,3 @@ $_SESSION['breadCrumbArray'][] = ['display' => __('view'), 'href' => ''];
|
||||
|
||||
# Start page output
|
||||
$serverOverview->serverOverviewOutPut();
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user