]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - header.php
2 if (is_auth_provided() && !str_ends_with($_SERVER['SCRIPT_FILENAME'], "setup.php"))
6 $arr = []; Hook
::run(HOOKTYPE_PRE_HEADER
, $arr); ?>
9 var BASE_URL
= "<?php echo get_config("base_url
"); ?>";
10 function timeoutCheck() {
11 var xhttp
= new XMLHttpRequest();
12 xhttp
.onreadystatechange
= function() {
13 if (this
.readyState
== 4 && this
.status
== 200) {
14 var data
= JSON
.parse(this
.responseText
);
15 if (data
.session
== 'none')
16 window
.location
= BASE_URL +
'login/?timeout=1&redirect=' +
encodeURIComponent(window
.location
.pathname
);
19 xhttp
.open("GET", BASE_URL +
"api/timeout.php", true);
23 setInterval(timeoutCheck
, 15000);
26 <div
class="media-body">
28 <meta name
="viewport" content
="width=device-width, initial-scale=1">
29 <meta name
="HandheldFriendly" content
="true">
31 <link href
="<?php echo get_config("base_url
"); ?>css/unrealircd-admin.css" rel
="stylesheet">
34 <!-- Latest compiled
and minified CSS
-->
35 <link rel
="stylesheet" href
="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
37 <!-- Font Awesome JS
-->
38 <script defer src
="https://use.fontawesome.com/releases/v6.2.1/js/solid.js" integrity
="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin
="anonymous"></script
>
39 <script defer src
="https://use.fontawesome.com/releases/v6.2.1/js/fontawesome.js" integrity
="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin
="anonymous"></script
>
41 <!-- Font Awesome icons
-->
42 <link rel
="stylesheet" href
="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
43 <title
>UnrealIRCd Panel
</title
>
44 <link rel
="icon" type
="image/x-icon" href
="<?php echo get_config("base_url
"); ?>img/favicon.ico">
46 <body role
="document">
48 <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
>
49 <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
>
50 <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
>
51 <script src
="<?php echo get_config("base_url
"); ?>js/unrealircd-admin.js"></script
>
54 transition
: left
0.3s
;
57 transition
: left
0.3s
;
62 transition
: left
0.3s
;
65 transition
: padding
-left
0.3s
;
67 .list-group
-item
-action
{
71 <link rel
="stylesheet" href
="https://www.w3schools.com/w3css/4/w3.css">
72 <nav id
="sidebarlol" style
="left: 0" class="w3-sidebar navbar-expand-sm bg-dark padding-top me-5 ma-5">
73 <div
class="sidebarlol list-group">
74 <div
class="badge badge-secondary rounded-pill">Main Menu
</div
>
77 function show_page_item($name, $page, $nestlevel)
81 $class = "nav-link nav-item";
82 if (is_string($active_page) && $page == $active_page)
88 $name = " ".$name;
89 $style = "padding-bottom: 1px; padding-top: 1px";
95 $style = "padding-bottom: 0px;";
97 echo "<a href=\"".get_config("base_url").$page."\" style=\"text-decoration: none\">\n";
99 echo "<div class=\"d-flex justify-content-between align-items-center $class list-group-item-action\" style=\"$style\">$name
100 <div class=\"text-right padding-top\">
101 <i class=\"fa fa-$icon\"></i>
103 if (!is_array($page))
111 foreach ($page as $subname=>$subpage)
112 show_page_item($subname, $subpage, 1);
115 foreach($pages as $name=>$page)
116 show_page_item($name, $page, 0);
121 <div
class="container-fluid">
123 <!-- Fixed navbar
-->
124 <nav
class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top z-index padding-top" style
="max-height: 50px">
125 <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
>
126 <button
class="navbar-toggler" type
="button" data
-toggle
="collapse" data
-target
="#collapsibleNavbar">
127 <span
class="navbar-toggler-icon"></span
>
129 <div
class="collapse navbar-collapse" id
="collapsibleNavbar">
130 <ul
class="navbar-nav mr-auto">
134 foreach ($pages as $name => $page)
136 $script = $_SERVER['SCRIPT_FILENAME'];
137 $tok = split($script, "/");
140 if (is_string($page) && strlen($page) == 0) {
143 else if (str_ends_with($script, get_config("base_url") . "index.php") && get_config("base_url") != "/" && !strlen($tok[0]))
145 $active_page = $tok[0];
147 else if (!str_ends_with($page, ".php"))
149 $script2 = rtrim($script, "/index.php");
150 if (str_ends_with($script2, $page))
151 $active_page = $page;
153 else if (str_ends_with($script, $page))
155 $active_page = $page;
156 } elseif (!$active_page)
157 $active_page = false;
160 $ToD = time_of_day();
161 $user = unreal_get_current_user();
164 $name = ($user->first_name
&& strlen($user->first_name
)) ? $user->first_name
: $user->username
; // address them by first name, else username
171 <?php
if ($user) { ?>
172 <div
class="nav-item form-inline my-2 my-lg-0 mr-sm-2">
173 <div
class="collapse navbar-collapse" id
="collapsibleNavbar">
174 <ul
class="navbar-nav mr-auto">
175 <li
class="nav-item dropdown">
176 <h6 style
="color:white;">Good
<?php
echo "$ToD, $name!"; ?></h6
>
185 <div id
="main_contain" class="container-fluid" style
="padding-left: 210px" role
="main">