if (is_auth_provided() && !str_ends_with($_SERVER['SCRIPT_FILENAME'], "setup.php"))
{?>
<script>
- var BASE_URL = "<?php echo BASE_URL; ?>";
+ var get_config("base_url") = "<?php echo get_config("base_url"); ?>";
function timeoutCheck() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var data = JSON.parse(this.responseText);
if (data.session == 'none')
- window.location = BASE_URL + 'login/?timeout=1&redirect=' + encodeURIComponent(window.location.pathname);
+ window.location = get_config("base_url") + 'login/?timeout=1&redirect=' + encodeURIComponent(window.location.pathname);
}
};
- xhttp.open("GET", BASE_URL + "api/timeout.php", true);
+ xhttp.open("GET", get_config("base_url") + "api/timeout.php", true);
xhttp.send();
}
timeoutCheck();
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="HandheldFriendly" content="true">
-<link href="<?php echo BASE_URL; ?>css/unrealircd-admin.css" rel="stylesheet">
+<link href="<?php echo get_config("base_url"); ?>css/unrealircd-admin.css" rel="stylesheet">
<!-- Latest compiled and minified CSS -->
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
-<script src="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script>
<title>UnrealIRCd Panel</title>
-<link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>img/favicon.ico">
+<link rel="icon" type="image/x-icon" href="<?php echo get_config("base_url"); ?>img/favicon.ico">
</head>
<body role="document">
-<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
-<!-- Popper.JS -->
-<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
-<!-- Bootstrap JS -->
-<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
+<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
+<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
+<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
+<script src="<?php echo get_config("base_url"); ?>js/unrealircd-admin.js"></script>
<style>
#optionsopen {
transition: left 0.3s;
transition: padding-left 0.3s;
}
.list-group-item-action {
- color: white;
+ color: #e0e0e0;
}
</style>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<div class="sidebarlol list-group">
<div class="badge badge-secondary rounded-pill">Main Menu</div>
<?php
-$active_page = NULL;
function show_page_item($name, $page, $nestlevel)
{
- $icon = "";
+ $active_page = NULL;
+ $icon = $style = "";
$class = "nav-link nav-item";
if (is_string($active_page) && $page == $active_page)
$class .= " active";
{
echo "<small>";
$name = " ".$name;
+ $style = "padding-bottom: 1px; padding-top: 1px";
+ } else {
+ echo "<b>";
+ }
+ if (is_array($page))
+ {
+ $style = "padding-bottom: 0px;";
+ } else {
+ echo "<a href=\"".get_config("base_url").$page."\" style=\"text-decoration: none\">\n";
}
- echo "<a href=\"".BASE_URL.$page."\" style=\"text-decoration: none\"><div class=\"d-flex justify-content-between align-items-center $class list-group-item-action\" style=\"padding-bottom: 0px\">$name
+ echo "<div class=\"d-flex justify-content-between align-items-center $class list-group-item-action\" style=\"$style\">$name
<div class=\"text-right padding-top\">
<i class=\"fa fa-$icon\"></i>
- </div></div></a>\n";
+ </div></div>\n";
+ if (!is_array($page))
+ echo "</a>";
if ($nestlevel > 0)
echo "</small>";
- foreach ($page as $subname=>$subpage)
- show_page_item($subname, $subpage, 1);
+ else
+ echo "</b>";
+ if (is_array($page))
+ {
+ foreach ($page as $subname=>$subpage)
+ show_page_item($subname, $subpage, 1);
+ }
}
foreach($pages as $name=>$page)
show_page_item($name, $page, 0);
<!-- Fixed navbar -->
<nav class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top z-index padding-top" style="max-height: 50px">
- <a class="navbar-brand" href="<?php echo BASE_URL; ?>"><img src="<?php echo BASE_URL; ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
+ <a class="navbar-brand" href="<?php echo get_config("base_url"); ?>"><img src="<?php echo get_config("base_url"); ?>img/favicon.ico" height="25" width="25"> UnrealIRCd Admin Panel</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
if (is_string($page) && strlen($page) == 0) {
$active_page = "";
}
- else if (str_ends_with($script, BASE_URL . "index.php") && BASE_URL != "/" && !strlen($tok[0]))
+ else if (str_ends_with($script, get_config("base_url") . "index.php") && get_config("base_url") != "/" && !strlen($tok[0]))
{
$active_page = $tok[0];
}