]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - index.php
Make css portable lol
[irc/unrealircd/unrealircd-webpanel.git] / index.php
1 <!DOCTYPE html>
2 <link href="css/unrealircd-admin.css" rel="stylesheet">
3 <body>
4 <div id="headerContainer">
5 <h2>UnrealIRCd <small>Administration Panel</small></h2><br>
6 </div>
7 <script src="js/unrealircd-admin.js" defer></script>
8 <div class="topnav">
9 <a data-tab-target="#overview" class="active" href="#overview">Overview</a>
10 <a data-tab-target="#Users" href="#Users">Users</a>
11 <a data-tab-target="#Channels" href="#Channels">Channels</a>
12 <a data-tab-target="#TKL" href="#TKL">Server Bans</a>
13 <a data-tab-target="#Spamfilter" href="#Spamfilter">Spamfilter</a>
14 </div>
15 <?php
16 /**
17 * Provide a admin area view for the plugin
18 *
19 * This file is used to markup the admin-facing aspects of the plugin.
20 *
21 * @link https://https://github.com/ValwareIRC
22 * @since 1.0.0
23 *
24 * @package Unrealircd
25 * @subpackage Unrealircd/admin/partials
26 */
27
28 define('UPATH', true);
29 include "Classes/class-rpc.php";
30
31 rpc_pop_lists(); // populate our static lists (users, channels, tkl, spamfilter)
32 ?>
33
34 <div class="tab-content\">
35 <div id="overview" data-tab-content class="active">
36 <table class='unrealircd_overview'>
37 <th>Chat Overview</th><th></th>
38 <tr><td><b>Users</b></td><td><?php echo count(RPC_List::$user); ?></td></tr>
39 <tr><td><b>Opers</b></td><td><?php echo RPC_List::$opercount; ?></td></tr>
40 <tr><td><b>Services</b></td><td><?php echo RPC_List::$services_count; ?></td></tr>
41 <tr><td><b>Most popular channel</b></td><td><?php echo RPC_List::$most_populated_channel; ?> (<?php echo RPC_List::$channel_pop_count; ?> users)</td></tr>
42 <tr><td><b>Channels</b></td><td><?php echo count(RPC_List::$channel); ?></td></tr>
43 <tr><td><b>Server bans</b></td><td><?php echo count(RPC_List::$tkl); ?></td></tr>
44 <tr><td><b>Spamfilter entries</b></td><td><?php echo count(RPC_List::$spamfilter); ?></td></tr></th>
45 </table></div></div>
46
47 <div class="tab-content\">
48 <div id="Users" data-tab-content>
49 <p></p>
50 <table class='users_overview'>
51 <th>Nick</th>
52 <th>UID</th>
53 <th>Host / IP</th>
54 <th>Account</th>
55 <th>Usermodes</th>
56 <th>Oper</th>
57 <th>Secure</th>
58 <th>Connected to</th>
59 <th>Reputation <a href="https://www.unrealircd.org/docs/Reputation_score"></a>ℹ️</th>
60
61 <?php
62 foreach(RPC_List::$user as $user)
63 {
64 echo "<tr>";
65 echo "<td>".$user['name']."</td>";
66 echo "<td>".$user['id']."</td>";
67 echo "<td>".$user['hostname']." (".$user['ip'].")</td>";
68 $account = (isset($user['account'])) ? $user['account'] : "";
69 echo "<td>".$account."</td>";
70 $modes = (isset($user['user']['modes'])) ? "+" . $user['user']['modes'] : "<none>";
71 echo "<td>".$modes."</td>";
72 $oper = (isset($user['user']['operlogin'])) ? $user['user']['operlogin']." (".$user['user']['operclass'].")" : "";
73 echo "<td>".$oper."</td>";
74 $secure = (isset($user['tls'])) ? "✅" : "❌";
75 echo "<td>".$secure."</td>";
76 echo "<td>".$user['user']['servername']."</td>";
77 echo "<td>".$user['user']['reputation']."</td>";
78 }
79 ?></table></div></div>
80
81 <div class="tab-content\">
82 <div id="Channels" data-tab-content>
83 <p></p>
84 <table class='users_overview'>
85 <th>Name</th>
86 <th>Created</th>
87 <th>User count</th>
88 <th>Topic</th>
89 <th>Topic Set</th>
90 <th>Modes</th>
91
92 <?php
93 foreach(RPC_List::$channel as $channel)
94 {
95 echo "<tr>";
96 echo "<td>".$channel['name']."</td>";
97 echo "<td>".$channel['creation_time']."</td>";
98 echo "<td>".$channel['num_users']."</td>";
99 $topic = (isset($channel['topic'])) ? $channel['topic'] : "";
100 echo "<td>".$topic."</td>";
101 $setby = (isset($channel['topic'])) ? "By ".$channel['topic_set_by'] .", at ".$channel['topic_set_at'] : "";
102 echo "<td>".$setby."</td>";
103 $modes = (isset($channel['modes'])) ? "+" . $channel['modes'] : "<none>";
104 echo "<td>".$modes."</td>";
105 }
106 ?></table></div></div>
107
108
109 <div class="tab-content\">
110 <div id="TKL" data-tab-content>
111 <p></p>
112 <table class='users_overview'>
113 <th>Mask</th>
114 <th>Type</th>
115 <th>Set By</th>
116 <th>Set On</th>
117 <th>Expires</th>
118 <th>Duration</th>
119 <th>Reason</th>
120
121 <?php
122 foreach(RPC_List::$tkl as $tkl)
123 {
124 echo "<tr>";
125 echo "<td>".$tkl['name']."</td>";
126 echo "<td>".$tkl['type_string']."</td>";
127 echo "<td>".$tkl['set_by']."</td>";
128 echo "<td>".$tkl['set_at_string']."</td>";
129 echo "<td>".$tkl['expire_at_string']."</td>";
130 echo "<td>".$tkl['duration_string']."</td>";
131 echo "<td>".$tkl['reason']."</td>";
132 }
133 ?></table></div></div>
134
135
136 <div class="tab-content\">
137 <div id="Spamfilter" data-tab-content>
138 <p></p>
139 <table class='users_overview'>
140 <th>Mask</th>
141 <th>Type</th>
142 <th>Set By</th>
143 <th>Set On</th>
144 <th>Expires</th>
145 <th>Duration</th>
146 <th>Match Type</th>
147 <th>Action</th>
148 <th>Action Duration</th>
149 <th>Target</th>
150 <th>Reason</th>
151
152 <?php
153 foreach(RPC_List::$spamfilter as $sf)
154 {
155 echo "<tr>";
156 echo "<td>".$sf['name']."</td>";
157 echo "<td>".$sf['type_string']."</td>";
158 echo "<td>".$sf['set_by']."</td>";
159 echo "<td>".$sf['set_at_string']."</td>";
160 echo "<td>".$sf['expire_at_string']."</td>";
161 echo "<td>".$sf['duration_string']."</td>";
162 echo "<td>".$sf['match_type']."</td>";
163 echo "<td>".$sf['ban_action']."</td>";
164 echo "<td>".$sf['ban_duration_string']."</td>";
165 for ($i = 0, $targs = ""; ($c = $sf['spamfilter_targets'][$i]); $i++)
166 {
167 if ($c == "c")
168 $targs .= "Channel, ";
169 else if ($c == "p")
170 $targs .= "Private,";
171 else if ($c == "n")
172 $targs .= "Notice, ";
173 else if ($c == "N")
174 $targs .= "Channel notice, ";
175 else if ($c == "P")
176 $targs .= "Part message, ";
177 else if ($c == "q")
178 $targs .= "Quit message, ";
179 else if ($c == "d")
180 $targs .= "DCC filename, ";
181 else if ($c == "a")
182 $targs .= "Away message, ";
183 else if ($c == "t")
184 $targs .= "Channel topic, ";
185 else if ($c == "T")
186 $targs .= "MessageTag, ";
187 else if ($c == "u")
188 $targs .= "Usermask, ";
189
190 $targs = rtrim($targs,", ");
191 }
192 echo "<td>".$targs."</td>";
193 echo "<td>".$sf['reason']."</td>";
194
195 }
196 ?></table></div></div>
197
198 </body>
199
200 <div class="footer"><p>Copyright 2022 © <a href="https://unrealircd.org/">UnrealIRCd</a></p></div>