]>
Commit | Line | Data |
---|---|---|
e98b5a51 | 1 | <?php |
81fe28b9 | 2 | if (version_compare(PHP_VERSION, '8.0.0', '<')) |
fcd08f14 | 3 | die("This webserver is using PHP version ".PHP_VERSION." but we require at least PHP 8.0.0.<br>". |
81fe28b9 BM |
4 | "If you already installed PHP8 but are still seeing this error, then it means ". |
5 | "apache/nginx/.. is loading an older PHP version. Eg. on Debian/Ubuntu you need ". | |
6 | "<code>apt-get install libapache2-mod-php8.2</code> (or a similar version) and ". | |
7 | "<code>apt-get remove libapache2-mod-php7.4</code> (or a similar version). ". | |
8 | "You may also need to choose again the PHP module to load in apache via <code>a2enmod php8.2</code>"); | |
9 | ||
e98b5a51 | 10 | define('UPATH', dirname(__FILE__)); |
d72d1923 | 11 | require_once UPATH . "/config.php"; |
e010b54c | 12 | if (!defined('BASE_URL')) die("You need to define BASE_URL in config.php (see config.php.sample for documentation)"); |
55fd88eb | 13 | require_once "Classes/class-hook.php"; |
c4f272ad BM |
14 | if (!is_dir(UPATH . "/vendor")) |
15 | die("The vendor/ directory is missing. Most likely the admin forgot to run 'composer install'\n"); | |
e98b5a51 | 16 | require_once UPATH . '/vendor/autoload.php'; |
e92763ac | 17 | require_once UPATH . "/Classes/class-cmodes.php"; |
d72d1923 | 18 | require_once UPATH . "/cfg/defines.php"; |
d72d1923 | 19 | require_once UPATH . "/misc/strings.php"; |
e92763ac | 20 | require_once UPATH . "/misc/channel-lookup-misc.php"; |
d72d1923 VP |
21 | require_once UPATH . "/misc/user-lookup-misc.php"; |
22 | require_once UPATH . "/misc/server-lookup-misc.php"; | |
23 | require_once UPATH . "/misc/ip-whois-misc.php"; | |
24 | require_once UPATH . "/Classes/class-log.php"; | |
25 | require_once UPATH . "/Classes/class-message.php"; | |
26 | require_once UPATH . "/Classes/class-rpc.php"; | |
6930484c | 27 | require_once UPATH . "/Classes/class-paneluser.php"; |
d72d1923 | 28 | require_once UPATH . "/plugins.php"; |
1e6ffd06 | 29 | |
5a7f0cde | 30 | $pages = [ |
69f605af BM |
31 | "Overview" => "", |
32 | "Users" => "users", | |
33 | "Channels" => "channels", | |
34 | "Servers" => "servers", | |
33f512fa VP |
35 | "Server Bans" => [ |
36 | "Server Bans" => "server-bans", | |
37 | "Name Bans" => "server-bans/name-bans.php", | |
38 | "Ban Exceptions" => "server-bans/ban-exceptions.php" | |
39 | ], | |
69f605af | 40 | "Spamfilter" => "spamfilter.php", |
e6ad9895 VP |
41 | "Tools" => [ |
42 | "IP WHOIS" => "tools/ip-whois.php", | |
43 | ], | |
b65f0496 | 44 | "Settings" => [ |
b65f0496 VP |
45 | "Plugins" => "settings/plugins.php", |
46 | ], | |
180b8ec1 | 47 | |
c00c34d2 | 48 | "News" => "news.php", |
5a7f0cde | 49 | ]; |
c00c34d2 VP |
50 | |
51 | if (is_auth_provided()) | |
180b8ec1 | 52 | { |
c00c34d2 | 53 | $pages["Settings"]["Panel Access"] = "settings"; |
90dc8f2b | 54 | |
c00c34d2 VP |
55 | $user = unreal_get_current_user(); |
56 | if ($user) | |
57 | { | |
58 | /* Add logout page, if logged in */ | |
59 | $pages["Logout"] = "login/?logout=true"; | |
60 | } | |
61 | } | |
90dc8f2b VP |
62 | Hook::run(HOOKTYPE_NAVBAR, $pages); |
63 | ||
64 | /* Example to add new menu item: | |
90dc8f2b VP |
65 | * |
66 | * class MyPlugin | |
67 | * { | |
68 | * | |
55fd88eb VP |
69 | * function __construct() |
70 | * { | |
71 | * Hook::func(HOOKTYPE_NAVBAR, [$this, 'add_menu']) | |
72 | * } | |
90dc8f2b | 73 | * |
55fd88eb VP |
74 | * function add_menu(&$pages) // this should pass by reference (using the & prefix) |
75 | * { | |
76 | * $page_name = "My New Page"; | |
77 | * $page_link = "link/to/page.php"; | |
78 | * $pages[$page_name] = $page_link; | |
79 | * } | |
90dc8f2b VP |
80 | * } |
81 | */ |