]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - header.php
2 if (is_auth_provided() && !str_ends_with($_SERVER['SCRIPT_FILENAME'], "setup.php"))
5 var BASE_URL
= "<?php echo BASE_URL; ?>";
6 function timeoutCheck() {
7 var xhttp
= new XMLHttpRequest();
8 xhttp
.onreadystatechange
= function() {
9 if (this
.readyState
== 4 && this
.status
== 200) {
10 var data
= JSON
.parse(this
.responseText
);
11 if (data
.session
== 'none')
12 window
.location
= BASE_URL +
'login/?timeout=1&redirect=' +
encodeURIComponent(window
.location
.pathname
);
15 xhttp
.open("GET", BASE_URL +
"api/timeout.php", true);
19 setInterval(timeoutCheck
, 15000);
22 $arr = []; Hook
::run(HOOKTYPE_PRE_HEADER
, $arr); ?>
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 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 <script src
="<?php echo BASE_URL; ?>js/unrealircd-admin.js"></script
>
44 <title
>UnrealIRCd Panel
</title
>
45 <link rel
="icon" type
="image/x-icon" href
="<?php echo BASE_URL; ?>img/favicon.ico">
47 <body role
="document">
49 <script src
="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity
="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin
="anonymous"></script
>
51 <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
>
53 <script src
="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity
="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin
="anonymous"></script
>
56 transition
: left
0.3s
;
59 transition
: left
0.3s
;
64 transition
: left
0.3s
;
67 transition
: padding
-left
0.3s
;
69 .list-group
-item
-action
{
73 <link rel
="stylesheet" href
="https://www.w3schools.com/w3css/4/w3.css">
74 <nav id
="sidebarlol" style
="left: 0" class="w3-sidebar navbar-expand-sm bg-dark padding-top me-5 ma-5">
75 <div
class="sidebarlol list-group">
76 <div
class="badge badge-secondary rounded-pill">Main Menu
</div
>
80 function show_page_item($name, $page, $nestlevel)
83 $class = "nav-link nav-item";
84 if (is_string($active_page) && $page == $active_page)
90 $name = " ".$name;
91 $style = "padding-bottom: 0px; padding-top: 0px";
94 $style = "padding-bottom: 0px;";
95 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=\"$style\">$name
96 <div class=\"text-right padding-top\">
97 <i class=\"fa fa-$icon\"></i>
101 foreach ($page as $subname=>$subpage)
102 show_page_item($subname, $subpage, 1);
104 foreach($pages as $name=>$page)
105 show_page_item($name, $page, 0);
110 <div
class="container-fluid">
112 <!-- Fixed navbar
-->
113 <nav
class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top z-index padding-top" style
="max-height: 50px">
114 <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
>
115 <button
class="navbar-toggler" type
="button" data
-toggle
="collapse" data
-target
="#collapsibleNavbar">
116 <span
class="navbar-toggler-icon"></span
>
118 <div
class="collapse navbar-collapse" id
="collapsibleNavbar">
119 <ul
class="navbar-nav mr-auto">
123 foreach ($pages as $name => $page)
125 $script = $_SERVER['SCRIPT_FILENAME'];
126 $tok = split($script, "/");
129 if (is_string($page) && strlen($page) == 0) {
132 else if (str_ends_with($script, BASE_URL
. "index.php") && BASE_URL
!= "/" && !strlen($tok[0]))
134 $active_page = $tok[0];
136 else if (!str_ends_with($page, ".php"))
138 $script2 = rtrim($script, "/index.php");
139 if (str_ends_with($script2, $page))
140 $active_page = $page;
142 else if (str_ends_with($script, $page))
144 $active_page = $page;
145 } elseif (!$active_page)
146 $active_page = false;
149 $ToD = time_of_day();
150 $user = unreal_get_current_user();
153 $name = ($user->first_name
&& strlen($user->first_name
)) ? $user->first_name
: $user->username
; // address them by first name, else username
160 <?php
if ($user) { ?>
161 <div
class="nav-item form-inline my-2 my-lg-0 mr-sm-2">
162 <div
class="collapse navbar-collapse" id
="collapsibleNavbar">
163 <ul
class="navbar-nav mr-auto">
164 <li
class="nav-item dropdown">
165 <h6 style
="color:white;">Good
<?php
echo "$ToD, $name!"; ?></h6
>
174 <div id
="main_contain" class="container-fluid" style
="padding-left: 210px" role
="main">