diff --git a/src/server/cyberhex-code/config.php b/src/server/cyberhex-code/config.php
new file mode 100644
index 0000000..0e3e4ab
--- /dev/null
+++ b/src/server/cyberhex-code/config.php
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/src/server/cyberhex-code/install/create_admin.php b/src/server/cyberhex-code/install/create_admin.php
new file mode 100644
index 0000000..a192200
--- /dev/null
+++ b/src/server/cyberhex-code/install/create_admin.php
@@ -0,0 +1,84 @@
+
+
+
+
+
+ Cyberhex Installation
+
+
+
+ Please create an admin user:
+
+
+connect_error) {
+ $success=0;
+ die("Connection failed: " . $conn->connect_error);
+ }
+ $stmt = $conn->prepare("INSERT INTO users (email, username, password,perms) VALUES (?, ?, ?)");
+ $stmt->bind_param("sss", $email, $username, $hash, $permissions);
+
+ $email=htmlspecialchars($_POST["email"]);
+ $username=htmlspecialchars($_POST["username"]);
+ $password=htmlspecialchars($_POST["password"]);
+ $permissions="1111111111";
+ $hash=password_hash('user_password_here', PASSWORD_BCRYPT);
+
+ $conn->execute();
+ $conn->close();
+ echo('Admin created successfully! Continue installation
');
+ }
+
+?>
+
\ No newline at end of file
diff --git a/src/server/cyberhex-code/install/create_db.php b/src/server/cyberhex-code/install/create_db.php
index c9ad48d..6cfd7cf 100644
--- a/src/server/cyberhex-code/install/create_db.php
+++ b/src/server/cyberhex-code/install/create_db.php
@@ -1,24 +1,46 @@
-
+
+
+
+
+ Cyberhex Installation
+
+
+
+ We are creating the databases used in cyberhex, please stand by
+
+
+
+connect_error) {
+ $success=0;
die("Connection failed: " . $conn->connect_error);
}
// Create database
$sql = "CREATE DATABASE IF NOT EXISTS $database";
if ($conn->query($sql) === TRUE) {
- echo "Database created successfully\n";
+ echo "Database created successfully
";
} else {
- echo "Error creating database: " . $conn->error;
+ $success=0;
+ echo "Error creating database: " . $conn->error ."
";
}
$conn->close();
@@ -28,6 +50,7 @@ $conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
+ $success=0;
die("Connection failed: " . $conn->connect_error);
}
@@ -41,9 +64,10 @@ $sql = "CREATE TABLE IF NOT EXISTS users (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'users' created successfully\n";
+ echo "Table 'users' created successfully
";
} else {
- echo "Error creating table: " . $conn->error;
+ $success=0;
+ echo "Error creating table: " . $conn->error ."
";
}
// Create log table
@@ -55,9 +79,10 @@ $sql = "CREATE TABLE IF NOT EXISTS log (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'log' created successfully\n";
+ echo "Table 'log' created successfully
";
} else {
- echo "Error creating table: " . $conn->error;
+ $success=0;
+ echo "Error creating table: " . $conn->error ."
";
}
// Create settings table
@@ -68,9 +93,10 @@ $sql = "CREATE TABLE IF NOT EXISTS settings (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'settings' created successfully\n";
+ echo "Table 'settings' created successfully
";
} else {
- echo "Error creating table: " . $conn->error;
+ $success=0;
+ echo "Error creating table: " . $conn->error ."
";
}
// Create api table
@@ -81,9 +107,10 @@ $sql = "CREATE TABLE IF NOT EXISTS api (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'api' created successfully\n";
+ echo "Table 'api' created successfully
";
} else {
- echo "Error creating table: " . $conn->error;
+ $success=0;
+ echo "Error creating table: " . $conn->error ."
";
}
// Create secrets table
@@ -94,9 +121,10 @@ $sql = "CREATE TABLE IF NOT EXISTS secrets (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'secrets' created successfully\n";
+ echo "Table 'secrets' created successfully
";
} else {
- echo "Error creating table: " . $conn->error;
+ $success=0;
+ echo "Error creating table: " . $conn->error ."
";
}
// Create machine table
@@ -108,9 +136,16 @@ $sql = "CREATE TABLE IF NOT EXISTS machines (
)";
if ($conn->query($sql) === TRUE) {
- echo "Table 'machines' created successfully\n";
+ echo "Table 'machines' created successfully
";
} else {
- echo "Error creating table: " . $conn->error;
+ $success=0;
+ echo "Error creating table: " . $conn->error ."
";
+}
+
+if($success!==1){
+ echo('There was an error creating the databases. Please try again or contact support at: info.jakach@gmail.com
');
+}else{
+ echo('Database created successfully! Continue installation
');
}
$conn->close();
diff --git a/src/server/cyberhex-code/install/end.php b/src/server/cyberhex-code/install/end.php
new file mode 100644
index 0000000..295d4df
--- /dev/null
+++ b/src/server/cyberhex-code/install/end.php
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Cyberhex Installation
+
+
+
+ You have installed cyberhex! Thank you for choosing us!
+ Finish installation.
+
+There was an error finishing the installation. Please try again or contact support at: info.jakach@gmail.com');
+ }else{
+ echo('All done, you can now start using cyberhex! Go to login page
');
+ }
+
+
+}
+?>
+
diff --git a/src/server/cyberhex-code/install/welcome.php b/src/server/cyberhex-code/install/welcome.php
index 238a216..8e7b73a 100644
--- a/src/server/cyberhex-code/install/welcome.php
+++ b/src/server/cyberhex-code/install/welcome.php
@@ -17,6 +17,8 @@
Welcome to the Cyberhex Installation
- This is a simple webpage for the Cyberhex installation. Customize it as needed for your specific requirements.
+ The installer will guide you through the installation.
+ If there are any errors during installation or you are stuck, please contatact info.jakach@gmail.com
+ Start installation.