Added backend validation

This commit is contained in:
dqos 2022-01-17 13:12:35 +01:00
parent fa5dd79308
commit 5bbd06c397
2 changed files with 4 additions and 3 deletions

View file

@ -21,7 +21,8 @@ use Hybula\LookingGlass;
LookingGlass::validateConfig();
LookingGlass::startSession();
if ($_SESSION['TARGET'] && $_SESSION['METHOD']) {
if ($_SESSION['TARGET'] && $_SESSION['METHOD'] && isset($_SESSION['BACKEND'])) {
unset($_SESSION['BACKEND']);
switch ($_SESSION['METHOD']) {
case 'ping':
LookingGlass::ping($_SESSION['TARGET']);

View file

@ -61,7 +61,7 @@ if (!empty($_POST)) {
}
}
$_SESSION['TERMS'] = true;
$callBackend = true;
$_SESSION['BACKEND'] = true;
break;
}
$errorMessage = 'Unsupported POST received.';
@ -265,7 +265,7 @@ if (LG_BLOCK_CUSTOM) {
</div>
<script type="text/javascript">
<?php if (isset($callBackend)) { echo 'callBackend();'; } ?>
<?php if (isset($_SESSION['BACKEND'])) { echo 'callBackend();'; } ?>
function callBackend() {
const executeButton = document.getElementById('executeButton');
executeButton.innerText = 'Executing...';