A lot of code cleanup and code sanitation done.

This commit is contained in:
2026-06-20 00:31:32 +02:00
parent be392b8149
commit d781078c0d
100 changed files with 733 additions and 2097 deletions

View File

@@ -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>