„vm_control.php“ ändern

This commit is contained in:
Stephan 2022-07-31 12:22:32 +00:00
parent ec6907e7ed
commit 90ee712d37

View file

@ -18,9 +18,12 @@
// Auswertung der Argumente:
// -----------------------------------------------
$error_msg = "";
$log_symbol = "️✅";
// leeren Parameter 'vmname' unterbinden:
if(!isset($_GET['vmname'])){
$error_msg = "EXIT - keine VM angegeben!<br>";
$log_symbol = "❌️";
}
// -----------------------------------------------
@ -43,18 +46,19 @@
// -----------------------------------------------
// check Key:
if(strcmp($_GET['key'], "$defined_key")) {
$error_msg = $error_msg."Zugriff verweigert!";
$error_msg = $error_msg."Zugriff verweigert!<br>Geloggter Zugriff von IP: ".$_SERVER['REMOTE_ADDR'];
$log_symbol = "❌️";
}
// -----------------------------------------------
// schreibe Status in Array:
// schreibe Status in Array, sofern es keinen Fehler gab:
if(empty($error_msg)){
$vm_state[$_GET['vmname']] = $_GET['state'];
$vm_state[$_GET['vmname']] = $_GET['state']."_".date("Y-m-d_H-i-s", time());
}
// -----------------------------------------------
// letzten Zugriff dokumentieren:
$log["LOG: ".date("Y-m-d_H-i-s", time())] = "VM: ".$_GET['vmname']." / Status: ".$_GET['state']." / Key: ".$_GET['key']." / IP: ".$_SERVER['REMOTE_ADDR'];
$log["LOG: ".date("Y-m-d_H-i-s", time())] = $log_symbol." VM: ".$_GET['vmname']." / Status: ".$_GET['state']." / Key: ".$_GET['key']." / IP: ".$_SERVER['REMOTE_ADDR'];
// -----------------------------------------------
// Daten speichern: