]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - api/installation.php
Move some PHP files from ./ to ./inc: common, connection, header, footer
[irc/unrealircd/unrealircd-webpanel.git] / api / installation.php
index ccc25b9f10e393cf8cf9d9e1ae03bb35535c8193..76711f36af7bb964e208a5452d09f157e5eaed5b 100644 (file)
@@ -1,41 +1,19 @@
 <?php
 
-require_once "../common.php";
+/** For handling installation BEFORE any backend and user is configured */
+
+require_once "../inc/common.php";
 
 /* only let this happen pre-config */
 if (file_exists("../config/config.php"))
                die(json_encode(["error" => "Configuration file exists."]));
-$method;
 
 if (!isset($_GET) || empty($_GET))
                die(json_encode(["error" => "Incorrect parameters"]));
 foreach($_GET as $key => $str)
                ${$key} = $str;
 
-if ($method == "rpc")
-{
-               if (isset($tls_verify))
-               {
-                               if ($tls_verify == "false")
-                                               $tls_verify = false;
-                               elseif ($tls_verify == "true")
-                                               $tls_verify = true;
-               }
-               try {
-                               $rpc = new UnrealIRCd\Connection
-                               (
-                                               "wss://$host:$port",
-                                               "$user:$password",
-                                               ["tls_verify" => $tls_verify]
-                               );
-               }
-               catch (Exception $e)
-               {
-                               die(json_encode(["error" => "Unable to connect to UnrealIRCd: ".$e->getMessage()]));
-               }
-               die(json_encode(["success" => "Successfully connected"]));
-}
-elseif ($method == "sql")
+if ($method == "sql")
 {
                $conn = mysqli_connect($host, $user, $password, $database);
 
@@ -47,4 +25,4 @@ elseif ($method == "sql")
                mysqli_close($conn);
                die(json_encode(["success" => "SQL Connection successful"]));
 
-}
\ No newline at end of file
+}