From 27c6817d4d2593256827c6be8d56c7d7402f2fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikki=20S=C3=B8rensen?= Date: Sat, 10 Mar 2018 01:43:59 +0100 Subject: [PATCH] making class to handle the script runing in web mode --- scripts/lib/web_mode.php | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 scripts/lib/web_mode.php diff --git a/scripts/lib/web_mode.php b/scripts/lib/web_mode.php new file mode 100644 index 0000000..c8dba48 --- /dev/null +++ b/scripts/lib/web_mode.php @@ -0,0 +1,50 @@ +request_handling(); + } + + function request_handling() + { + // Files - Always finde the correct path + $dir_path = __FILE__; + $dir_path = str_replace("web_mode.php", "", $dir_path); + $files = glob($dir_path . "../../*.txt"); + + // TODO: Update to support what services that shoud output + if (isset($_POST["conf"]) && $_POST["conf"] == "unbound") + { + require_once $dir_path . "../plugins/unbound.php"; + $unbound = new unbound("web"); + $unbound->make("web", $files, $_POST["ip"]); + } + else + { + $this->show_gui(); + } + } + + function show_gui() + { + ?> + +
+
+ unbound
+ Other
+ Other2
+ +
+ + \ No newline at end of file