2 <title
>UnrealIRCd Panel
</title
>
3 <link rel
="icon" type
="image/x-icon" href
="/img/favicon.ico">
4 <link href
="css/unrealircd-admin.css" rel
="stylesheet">
5 <body
class="body-for-sticky">
6 <div id
="headerContainer">
7 <h2
><a href
="">UnrealIRCd
<small
>Administration Panel
</small
></a
></h2
></div
>
8 <script src
="js/unrealircd-admin.js" defer
></script
>
10 <a data
-tab
-target
="#overview" class="active" href
="#overview">Overview
</a
>
11 <a data
-tab
-target
="#Users" href
="#Users">Users
</a
>
12 <a data
-tab
-target
="#Channels" href
="#Channels">Channels
</a
>
13 <a data
-tab
-target
="#TKL" href
="#TKL">Server Bans
</a
>
14 <a data
-tab
-target
="#Spamfilter" href
="#Spamfilter">Spamfilter
</a
>
15 <a data
-tab
-target
="#News" href
="#News">News
</a
>
18 define('UPATH', dirname(__FILE__
));
20 include "Classes/class-log.php";
21 include "Classes/class-message.php";
22 include "Classes/class-rpc.php";
26 if (!($bantype = $_POST['bantype'])) {
28 } else if (!($users = $_POST["userch"])) {
29 Message
::Fail("No user was specified");
31 foreach ($_POST["userch"] as $user) {
32 $user = base64_decode($user);
33 $bantype = (isset($_POST['bantype'])) ? $_POST['bantype'] : NULL;
36 Message
::Fail("An error occured");
39 $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL;
40 $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL;
41 $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL;
44 if (!$banlen_d && !$banlen_h && !$banlen_w)
50 $duration .= $banlen_w;
52 $duration .= $banlen_d;
54 $duration .= $banlen_h;
58 $rpc->set_method("user.get");
59 $rpc->set_params(["nick" => "$user"]);
61 $nick = ($rpc->result) ? $rpc->fetch_assoc() : NULL;
64 Message::Fail("Could not find that user
. Maybe they disconnected after you clicked this
?");
68 $msg_msg = ($duration == "0" || $duration == "0w0d0h
") ? "permanently
" : "for ".rpc_convert_duration_string($duration);
69 $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason
";
70 if (rpc_tkl_add($user, $bantype, $duration, $reason))
72 $c = $nick['result']['client'];
73 Message::Success($c['name'] . " (*@".$c['hostname'].") has been
$bantype" . "d $msg_msg: $reason");
78 if (!empty($_POST['tklch']))
79 foreach ($_POST as $key => $value) {
80 foreach ($value as $tok) {
81 $tok = explode(",", $tok);
82 if (rpc_tkl_del(base64_decode($tok[0]), base64_decode($tok[1])))
83 Message::Success(base64_decode($tok[1])." has been removed
for ".base64_decode($tok[0]));
87 if (!empty($_POST['sf']))
88 foreach ($_POST as $key => $value) {
89 foreach ($value as $tok) {
90 $tok = explode(",", $tok);
91 rpc_sf_del(base64_decode($tok[0]), base64_decode($tok[1]), base64_decode($tok[2]), base64_decode($tok[3]));
99 <div class="tab
-content\"
>
100 <div id
="overview" data
-tab
-content
class="active">
101 <table
class='unrealircd_overview'>
102 <th
>Chat Overview
</th
><th
></th
>
103 <tr
><td
><b
>Users
</b
></td
><td
><?php
echo count(RPC_List
::$user); ?></td
></tr
>
104 <tr
><td
><b
>Opers
</b
></td
><td
><?php
echo RPC_List
::$opercount; ?></td
></tr
>
105 <tr
><td
><b
>Services
</b
></td
><td
><?php
echo RPC_List
::$services_count; ?></td
></tr
>
106 <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
>
107 <tr
><td
><b
>Channels
</b
></td
><td
><?php
echo count(RPC_List
::$channel); ?></td
></tr
>
108 <tr
><td
><b
>Server bans
</b
></td
><td
><?php
echo count(RPC_List
::$tkl); ?></td
></tr
>
109 <tr
><td
><b
>Spamfilter entries
</b
></td
><td
><?php
echo count(RPC_List
::$spamfilter); ?></td
></tr
></th
>
112 <div
class="tab-content\">
113 <div id="Users
" data-tab-content>
114 <table class='users_filter'>
115 <th class="thuf
">Filter by: </th>
117 <form action="" method="post
">
118 Nick: <input name="uf_nick
" id="uf_nick
" type="text
">
119 <input class="cute_button2
" type="submit
" value="Search
">
123 <form action="" method="post
">
124 Hostname: <input name="uf_host
" id="uf_host
" type="text
">
125 <input class="cute_button2
" type="submit
" value="Search
">
129 <form action="" method="post
">
130 IP: <input name="uf_ip
" id="uf_ip
" type="text
">
131 <input class="cute_button2
" type="submit
" value="Search
">
135 <form action="" method="post
">
136 Account: <input name="uf_account
" id="uf_account
" type="text
">
137 <input class="cute_button2
" type="submit
" value="Search
">
143 if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']))
144 Message::Info("Listing users which match nick
: \"" . $_POST['uf_nick'] . "\"
");
146 if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']))
147 Message::Info("Listing users which match IP
: \"" . $_POST['uf_ip'] . "\"
");
149 if (isset($_POST['uf_host']) && strlen($_POST['uf_host']))
150 Message::Info("Listing users which match hostmask
: \"" . $_POST['uf_host'] . "\"
");
152 if (isset($_POST['uf_account']) && strlen($_POST['uf_account']))
153 Message::Info("Listing users which match account
: \"" . $_POST['uf_account'] . "\"
");
156 <table class='users_overview'>
157 <th><input type="checkbox
" label='selectall' onClick="toggle_user(this
)" />Select all</th>
162 <th>Usermodes<a href="https
://www.unrealircd.org/docs/User_modes" target="_blank">ℹ️</a></th>
165 <th
>Connected to
</th
>
166 <th
>Reputation
<a href
="https://www.unrealircd.org/docs/Reputation_score" target
="_blank">ℹ️
</a
></th
>
168 <form action
="" method
="post">
170 foreach(RPC_List
::$user as $user)
173 /* Some basic filtering for NICK */
174 if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']) &&
175 strpos(strtolower($user['name']), strtolower($_POST['uf_nick'])) !== 0 &&
176 strpos(strtolower($user['name']), strtolower($_POST['uf_nick'])) == false)
179 /* Some basic filtering for HOST */
180 if (isset($_POST['uf_host']) && strlen($_POST['uf_host']) &&
181 strpos(strtolower($user['hostname']), strtolower($_POST['uf_host'])) !== 0 &&
182 strpos(strtolower($user['hostname']), strtolower($_POST['uf_host'])) == false)
185 /* Some basic filtering for IP */
186 if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']) &&
187 strpos(strtolower($user['ip']), strtolower($_POST['uf_ip'])) !== 0 &&
188 strpos(strtolower($user['ip']), strtolower($_POST['uf_ip'])) == false)
191 /* Some basic filtering for ACCOUNT */
192 if (isset($_POST['uf_account']) && strlen($_POST['uf_account']) &&
193 strpos(strtolower($user['user']['account']), strtolower($_POST['uf_account'])) !== 0 &&
194 strpos(strtolower($user['user']['account']), strtolower($_POST['uf_account'])) == false)
198 echo "<td><input type=\"checkbox\" value='" . base64_encode($user['id'])."' name=\"userch[]\"></td>";
199 $isBot = (strpos($user['user']['modes'], "B") !== false) ? ' <span class="label">Bot</span>' : "";
200 echo "<td>".$user['name'].$isBot.'</td>';
201 echo "<td>".$user['id']."</td>";
202 echo "<td>".$user['hostname']." (".$user['ip'].")</td>";
203 $account = (isset($user['user']['account'])) ? '<span class="label">'.$user['user']['account'].'</span>' : '<span class="label noaccount">None</span>';
204 echo "<td>".$account."</td>";
205 $modes = (isset($user['user']['modes'])) ? "+" . $user['user']['modes'] : "<none>";
206 echo "<td>".$modes."</td>";
207 $oper = (isset($user['user']['operlogin'])) ? '<span class="label">'.$user['user']['operlogin']."</span> <span class=\"label operclass-label\">".$user['user']['operclass']."</span>" : "";
209 $oper = (strpos($user['user']['modes'], "S") !== false) ? '<span class="label secure-connection">Service</span>' : "";
210 echo "<td>".$oper."</td>";
211 $secure = (isset($user['tls'])) ? "<span class=\"label secure-connection\">Secure</span>" : "<span class=\"label noaccount\">Insecure</span>";
212 echo "<td>".$secure."</td>";
213 echo "<td>".$user['user']['servername']."</td>";
214 echo "<td>".$user['user']['reputation']."</td>";
217 <label
for="bantype">Apply action
: </label
><br
>
218 <select name
="bantype" id
="bantype">
219 <option value
=""></option
>
220 <optgroup label
="Bans">
221 <option value
="gline">GLine
</option
>
222 <option value
="gzline">GZLine
</option
>
226 <label
for="banlen_w">Duration
: </label
><br
>
227 <select name
="banlen_w" id
="banlen_w">
229 for ($i = 0; $i <= 56; $i++
)
232 echo "<option value=\"0w\"></option>";
235 $w = ($i == 1) ? "week" : "weeks";
236 echo "<option value=\"$i" . "w\"
>$i $w" . "</option>";
241 <select name
="banlen_d" id
="banlen_d">
243 for ($i = 0; $i <= 31; $i++
)
246 echo "<option value=\"0d\"></option>";
249 $d = ($i == 1) ? "day" : "days";
250 echo "<option value=\"$i" . "d\"
>$i $d" . "</option>";
255 <select name
="banlen_h" id
="banlen_h">
257 for ($i = 0; $i <= 24; $i++
)
260 echo "<option value=\"0d\"></option>";
263 $h = ($i == 1) ? "hour" : "hours";
264 echo "<option value=\"$i" . "h\"
>$i $h" . "</option>";
269 <br
><label
for="ban_reason">Reason
:<br
></label
>
270 <textarea name
="ban_reason" id
="ban_reason">No reason
</textarea
><br
>
271 <input
class="cute_button" type
="submit" value
="Apply">
276 <div
class="tab-content\">
277 <div id="Channels
" data-tab-content>
279 <table class='users_overview'>
288 foreach(RPC_List::$channel as $channel)
291 echo "<td
>".$channel['name']."</td
>";
292 echo "<td
>".$channel['creation_time']."</td
>";
293 echo "<td
>".$channel['num_users']."</td
>";
294 $topic = (isset($channel['topic'])) ? $channel['topic'] : "";
295 echo "<td
>".$topic."</td
>";
296 $setby = (isset($channel['topic'])) ? "By
".$channel['topic_set_by'] .", at
".$channel['topic_set_at'] : "";
297 echo "<td
>".$setby."</td
>";
298 $modes = (isset($channel['modes'])) ? "+
" . $channel['modes'] : "<none
>";
299 echo "<td
>".$modes."</td
>";
301 ?></table></div></div>
304 <div class="tab
-content\"
>
305 <div id
="TKL" data
-tab
-content
>
307 <table
class='users_overview'>
308 <form action
="" method
="post">
309 <th
><input type
="checkbox" label
='selectall' onClick
="toggle_tkl(this)" />Select all
</th
>
319 foreach(RPC_List
::$tkl as $tkl)
322 echo "<td><input type=\"checkbox\" value='" . base64_encode($tkl['name']).",".base64_encode($tkl['type']) . "' name=\"tklch[]\"></td>";
323 echo "<td>".$tkl['name']."</td>";
324 echo "<td>".$tkl['type_string']."</td>";
325 echo "<td>".$tkl['set_by']."</td>";
326 echo "<td>".$tkl['set_at_string']."</td>";
327 echo "<td>".$tkl['expire_at_string']."</td>";
328 echo "<td>".$tkl['duration_string']."</td>";
329 echo "<td>".$tkl['reason']."</td>";
331 ?></table
><p
><input
class="cute_button" type
="submit" value
="Delete selected"></p
></form
></div
></div
>
334 <div
class="tab-content\">
335 <div id="Spamfilter
" data-tab-content>
337 <table class='users_overview'>
338 <form action="" method="post
">
339 <th><input type="checkbox
" label='selectall' onClick="toggle_sf(this
)" />Select all</th>
348 <th>Action Duration</th>
353 foreach(RPC_List::$spamfilter as $sf)
356 echo "<td
><input type
=\"checkbox\" value
='" . base64_encode($sf['name
']).",".base64_encode($sf['match_type
']).",".base64_encode($sf['spamfilter_targets
']).",".base64_encode($sf['ban_action
']) . "' name
=\"sf
[]\"></td
>";
357 echo "<td
>".$sf['name']."</td
>";
358 echo "<td
>".$sf['type_string']."</td
>";
359 echo "<td
>".$sf['set_by']."</td
>";
360 echo "<td
>".$sf['set_at_string']."</td
>";
361 echo "<td
>".$sf['expire_at_string']."</td
>";
362 echo "<td
>".$sf['duration_string']."</td
>";
363 echo "<td
>".$sf['match_type']."</td
>";
364 echo "<td
>".$sf['ban_action']."</td
>";
365 echo "<td
>".$sf['ban_duration_string']."</td
>";
366 for ($i = 0, $targs = ""; ($c = $sf['spamfilter_targets'][$i]); $i++)
369 $targs .= "Channel
, ";
371 $targs .= "Private,";
373 $targs .= "Notice
, ";
375 $targs .= "Channel notice
, ";
377 $targs .= "Part message
, ";
379 $targs .= "Quit message
, ";
381 $targs .= "DCC filename
, ";
383 $targs .= "Away message
, ";
385 $targs .= "Channel topic
, ";
387 $targs .= "MessageTag
, ";
389 $targs .= "Usermask
, ";
391 $targs = rtrim($targs,", ");
393 echo "<td
>".$targs."</td
>";
394 echo "<td
>".$sf['reason']."</td
>";
397 ?></table><p><input class="cute_button
" type="submit
" value="Delete selected
"></p></form></div></div>
401 <div class="tab
-content\"
>
402 <div id
="News" data
-tab
-content
>
403 <iframe style
="border:none;" height
="1000" width
="600" data
-tweet
-url
="https://twitter.com/Unreal_IRCd" src
="data:text/html;charset=utf-8,%3Ca%20class%3D%22twitter-timeline%22%20href%3D%22https%3A//twitter.com/Unreal_IRCd%3Fref_src%3Dtwsrc%255Etfw%22%3ETweets%20by%20Unreal_IRCd%3C/a%3E%0A%3Cscript%20async%20src%3D%22https%3A//platform.twitter.com/widgets.js%22%20charset%3D%22utf-8%22%3E%3C/script%3E%0A%3Cstyle%3Ehtml%7Boverflow%3Ahidden%20%21important%3B%7D%3C/style%3E"></iframe
>
404 <iframe style
="border:none;" height
="1000" width
="600" data
-tweet
-url
="https://twitter.com/irc_stats" src
="data:text/html;charset=utf-8,%3Ca%20class%3D%22twitter-timeline%22%20href%3D%22https%3A//twitter.com/irc_stats%3Fref_src%3Dtwsrc%255Etfw%22%3ETweets%20by%20IRC%20Stats%3C/a%3E%0A%3Cscript%20async%20src%3D%22https%3A//platform.twitter.com/widgets.js%22%20charset%3D%22utf-8%22%3E%3C/script%3E%0A%3Cstyle%3Ehtml%7Boverflow%3Ahidden%20%21important%3B%7D%3C/style%3E"></iframe
>