X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/59d032c86464658baee13fad479403f411c2c56e..b6540c8fd85cca3e4e5c4dd40d3568884b3dbc6b:/common.php
diff --git a/common.php b/common.php
index edd219b..d685538 100644
--- a/common.php
+++ b/common.php
@@ -1,4 +1,12 @@
".
+ "If you already installed PHP8 but are still seeing this error, then it means ".
+ "apache/nginx/.. is loading an older PHP version. Eg. on Debian/Ubuntu you need ".
+ "apt-get install libapache2-mod-php8.2
(or a similar version) and ".
+ "apt-get remove libapache2-mod-php7.4
(or a similar version). ".
+ "You may also need to choose again the PHP module to load in apache via a2enmod php8.2
");
+
define('UPATH', dirname(__FILE__));
require_once UPATH . "/config.php";
if (!defined('BASE_URL')) die("You need to define BASE_URL in config.php (see config.php.sample for documentation)");
@@ -6,9 +14,10 @@ require_once "Classes/class-hook.php";
if (!is_dir(UPATH . "/vendor"))
die("The vendor/ directory is missing. Most likely the admin forgot to run 'composer install'\n");
require_once UPATH . '/vendor/autoload.php';
+require_once UPATH . "/Classes/class-cmodes.php";
require_once UPATH . "/cfg/defines.php";
-require_once UPATH . "/connection.php";
require_once UPATH . "/misc/strings.php";
+require_once UPATH . "/misc/channel-lookup-misc.php";
require_once UPATH . "/misc/user-lookup-misc.php";
require_once UPATH . "/misc/server-lookup-misc.php";
require_once UPATH . "/misc/ip-whois-misc.php";
@@ -33,17 +42,23 @@ $pages = [
"IP WHOIS" => "tools/ip-whois.php",
],
"Settings" => [
- "Panel Access" => "settings",
"Plugins" => "settings/plugins.php",
],
- "News" => "news.php",
+ "News" => "news.php",
];
-if (unreal_get_current_user())
+
+if (is_auth_provided())
{
- $pages["Logout"] = "login/?logout=true";
-}
+ $pages["Settings"]["Panel Access"] = "settings";
+ $user = unreal_get_current_user();
+ if ($user)
+ {
+ /* Add logout page, if logged in */
+ $pages["Logout"] = "login/?logout=true";
+ }
+}
Hook::run(HOOKTYPE_NAVBAR, $pages);
/* Example to add new menu item: