]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - common.php
automatically go to login page on session timeout
[irc/unrealircd/unrealircd-webpanel.git] / common.php
index 3b45630671635f50def5247525d1c8e29a9e6e28..d685538b8d2b55b607fa69f4ae54aa488c5ff504 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (version_compare(PHP_VERSION, '8.0.0', '<'))
-       die("This webserver is PHP version ".PHP_VERSION." but we require at least PHP 8.0.0.<br>".
+       die("This webserver is using PHP version ".PHP_VERSION." but we require at least PHP 8.0.0.<br>".
            "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 ".
            "<code>apt-get install libapache2-mod-php8.2</code> (or a similar version) and ".
@@ -42,19 +42,23 @@ $pages = [
                "IP WHOIS" => "tools/ip-whois.php",
        ],
        "Settings" => [
-               "Panel Access" => "settings",
                "Plugins" => "settings/plugins.php",
        ],
        
-       "News"         => "news.php",
+       "News" => "news.php",
 ];
-$user = unreal_get_current_user();
-if ($user)
+
+if (is_auth_provided())
 {
-       /* Add logout page, if logged in */
-       $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: