]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - settings/install.php
Move some PHP files from ./ to ./inc: common, connection, header, footer
[irc/unrealircd/unrealircd-webpanel.git] / settings / install.php
index ba8ba1c88c4a1f6abb4f7fbdc3f63f2a67e1b87d..26e563d7ba3b620c57a30948b9c412d007c03493 100644 (file)
@@ -1,6 +1,22 @@
 <?php
+/* Log the user out if it was logged in.
+ * This is mostly for devs running the install screen and
+ * fater succeeding the first screen suddenly being logged in
+ * with old credentials/uid weirdness.
+ * Code from example #1 at https://www.php.net/manual/en/function.session-destroy.php
+ */
+session_start();
+$_SESSION = Array();
+if (ini_get("session.use_cookies")) {
+    $params = session_get_cookie_params();
+    setcookie(session_name(), '', time() - 42000,
+        $params["path"], $params["domain"],
+        $params["secure"], $params["httponly"]
+    );
+}
+session_destroy();
 
-require_once "../common.php";
+require_once "../inc/common.php";
 
 /* Get the base url */
 $uri = $_SERVER['REQUEST_URI'];