diff --git a/src/server/cyberhex-code/system/secure_zone/php/add_client.php b/src/server/cyberhex-code/system/secure_zone/php/add_client.php index db19a97..19449ed 100644 --- a/src/server/cyberhex-code/system/secure_zone/php/add_client.php +++ b/src/server/cyberhex-code/system/secure_zone/php/add_client.php @@ -46,7 +46,7 @@ include "../../../config.php";
- +
@@ -96,6 +96,32 @@ include "../../../config.php"; $stmt->bind_param("ss", $machineid, $apikey); $stmt->execute(); $stmt->close(); + + //get the address of this server + $sql = "SELECT * FROM settings WHERE name = 'setting_server_server_url'"; + $stmt = $conn->prepare($sql); + // Execute the statement + $stmt->execute(); + // Get the result + $result = $stmt->get_result(); + $row = $result->fetch_assoc(); + if($row!==null){ + $this_server=$row["value"]; + } + $stmt -> close(); + //create the files and download them + file $fp; + $fp=fopen("/var/www/html/setup.txt"); + fwrite($fp,"$this_server"); + fclose($fp); + $fp=fopen("/var/www/html/secrets.txt"); + fwrite($fp,"machineid $machineid\n"); + fwrite($fp,"cert $cert\n"); + fwrite($fp,"apikey $apikey\n"); + fclose($fp); + echo("Download config file1"); + echo("Download config file2"); + echo("Download installer"); } ?>