From a379d739c84c9d89fd40401aa6540b4c58c90083 Mon Sep 17 00:00:00 2001 From: jakani24 Date: Thu, 20 Jun 2024 15:31:46 +0200 Subject: [PATCH] adding incident infrastructure --- .../system/secure_zone/php/incident_list.php | 109 ++++++++++++++++++ .../system/secure_zone/php/index.php | 6 +- .../secure_zone/php/manage_incident.php | 2 +- 3 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 src/server/cyberhex-code/system/secure_zone/php/incident_list.php diff --git a/src/server/cyberhex-code/system/secure_zone/php/incident_list.php b/src/server/cyberhex-code/system/secure_zone/php/incident_list.php new file mode 100644 index 0000000..421933f --- /dev/null +++ b/src/server/cyberhex-code/system/secure_zone/php/incident_list.php @@ -0,0 +1,109 @@ + + + + + + + + Change Password + + + +
+
+
+
+
+

Incident list

+
+
+ connect_error) { + die("Connection failed: " . $conn->connect_error); + } + + + //get count of users + + $sql = "SELECT count(*) AS incident_count FROM incidents"; + $stmt = $conn->prepare($sql); + // Execute the statement + $stmt->execute(); + // Get the result + $result = $stmt->get_result(); + $row = $result->fetch_assoc(); + $num_of_incidents=$row["incident_count"]; + $stmt->close(); + + // Create a connection + $conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE); + + // Check the connection + if ($conn->connect_error) { + die("Connection failed: " . $conn->connect_error); + } + $last_id=-1; + //create the table header + echo(''); + echo(''); + echo(''); + echo(''); + echo(''); + echo(''); + echo(''); + while($num_of_incidents!=0){ + $sql = "SELECT * FROM incidents where id > $last_id"; + $stmt = $conn->prepare($sql); + // Execute the statement + $stmt->execute(); + // Get the result + $result = $stmt->get_result(); + $row = $result->fetch_assoc(); + $last_id=$row["id"]; + $status=$row["status"]; + if($last_id!=1){ //number 1 is the unauthenticated user + echo(''); + echo(''); + echo(''); + echo(''); + echo(''); + } + $stmt->close(); + $num_of_incidents--; + } + echo(''); + echo('
Incident IdStatusGoto Incident
'.$last_id.''.$status.'Goto Incident
'); + $conn->close(); + ?> +
+
+
+
+
+ + diff --git a/src/server/cyberhex-code/system/secure_zone/php/index.php b/src/server/cyberhex-code/system/secure_zone/php/index.php index fd55f68..7d9903a 100644 --- a/src/server/cyberhex-code/system/secure_zone/php/index.php +++ b/src/server/cyberhex-code/system/secure_zone/php/index.php @@ -116,12 +116,10 @@ if(isset($_GET["page"])){ ?> diff --git a/src/server/cyberhex-code/system/secure_zone/php/manage_incident.php b/src/server/cyberhex-code/system/secure_zone/php/manage_incident.php index 77ea722..f01cac6 100644 --- a/src/server/cyberhex-code/system/secure_zone/php/manage_incident.php +++ b/src/server/cyberhex-code/system/secure_zone/php/manage_incident.php @@ -44,7 +44,7 @@ include "../../../api/php/log/add_server_entry.php"; //to log things
-

Client settings

+

Incident