]>
Commit | Line | Data |
---|---|---|
896b6cdc | 1 | <!DOCTYPE html> |
4d834e71 | 2 | <title>UnrealIRCd Panel</title> |
26971737 | 3 | <link rel="icon" type="image/x-icon" href="/img/favicon.ico"> |
46b1c955 | 4 | <link href="css/unrealircd-admin.css" rel="stylesheet"> |
26971737 | 5 | <body class="body-for-sticky"> |
82f5bcbf | 6 | <div id="headerContainer"> |
babf1a0e | 7 | <h2><a href="">UnrealIRCd <small>Administration Panel</small></a></h2></div> |
709b97f3 VP |
8 | <script src="js/unrealircd-admin.js" defer></script> |
9 | <div class="topnav"> | |
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> | |
26971737 | 15 | <a data-tab-target="#News" href="#News">News</a> |
709b97f3 VP |
16 | </div> |
17 | <?php | |
26971737 | 18 | define('UPATH', dirname(__FILE__)); |
03ddd26b BM |
19 | require_once "config.php"; |
20 | require_once UPATH . '/vendor/autoload.php'; | |
21 | require_once "connection.php"; | |
22 | require_once "Classes/class-log.php"; | |
23 | require_once "Classes/class-message.php"; | |
24 | require_once "Classes/class-rpc.php"; | |
25 | ||
26971737 | 26 | do_log($_POST); |
709b97f3 | 27 | |
26971737 | 28 | if (!empty($_POST)) { |
4a0980ad VP |
29 | if (!($bantype = $_POST['bantype'])) |
30 | { | |
31 | } | |
32 | else if (!($users = $_POST["userch"])) | |
33 | { | |
34 | /* check if this came from our Server Bans tab. */ | |
35 | if (!($iphost = $_POST['tkl_add'])) | |
36 | Message::Fail("No user was specified"); | |
26971737 | 37 | |
4a0980ad VP |
38 | else /* It did */ |
39 | { | |
40 | if (!strpos($iphost, "@")) // doesn't have full mask | |
41 | $iphost = "*@" . $iphost; | |
42 | /* duplicate code for now [= */ | |
43 | $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; | |
44 | $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; | |
45 | $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL; | |
46 | $duration = ""; | |
47 | if (!$banlen_d && !$banlen_h && !$banlen_w) | |
48 | $duration .= "0"; | |
49 | ||
50 | else | |
51 | { | |
52 | if ($banlen_w) | |
53 | $duration .= $banlen_w; | |
54 | if ($banlen_d) | |
55 | $duration .= $banlen_d; | |
56 | if ($banlen_h) | |
57 | $duration .= $banlen_h; | |
58 | } | |
59 | $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration); | |
60 | $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; | |
61 | if ($rpc->serverban()->add($iphost, $bantype, $duration, $reason)) | |
62 | { | |
63 | Message::Success("Host / IP: $iphost has been $bantype" . "d $msg_msg: $reason"); | |
64 | } | |
65 | else | |
66 | Message::Fail("The $bantype against \"$iphost\" could not be added."); | |
67 | } | |
68 | } | |
69 | else /* It came from the Users tab */ | |
70 | { | |
71 | foreach ($_POST["userch"] as $user) | |
72 | { | |
26971737 | 73 | $user = base64_decode($user); |
b063b4b2 | 74 | $bantype = (isset($_POST['bantype'])) ? $_POST['bantype'] : NULL; |
4a0980ad | 75 | if (!$bantype) /* shouldn't happen? */ |
b063b4b2 VP |
76 | { |
77 | Message::Fail("An error occured"); | |
78 | return; | |
79 | } | |
80 | $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; | |
81 | $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; | |
82 | $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL; | |
83 | ||
84 | $duration = ""; | |
85 | if (!$banlen_d && !$banlen_h && !$banlen_w) | |
86 | $duration .= "0"; | |
87 | ||
88 | else | |
89 | { | |
90 | if ($banlen_w) | |
91 | $duration .= $banlen_w; | |
92 | if ($banlen_d) | |
93 | $duration .= $banlen_d; | |
94 | if ($banlen_h) | |
95 | $duration .= $banlen_h; | |
96 | } | |
97 | ||
0d0013bb | 98 | $nick = $rpc->user()->get($user); |
b063b4b2 VP |
99 | if (!$nick) |
100 | { | |
101 | Message::Fail("Could not find that user. Maybe they disconnected after you clicked this?"); | |
102 | return; | |
103 | } | |
104 | ||
ffd01497 | 105 | $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration); |
b3898fc7 | 106 | $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; |
0d0013bb | 107 | if ($rpc->serverban()->add($user, $bantype, $duration, $reason)) |
b063b4b2 | 108 | { |
0d0013bb BM |
109 | $c = $nick->client; |
110 | Message::Success($c->name . " (*@".$c->hostname.") has been $bantype" . "d $msg_msg: $reason"); | |
b063b4b2 | 111 | } |
76200e36 VP |
112 | } |
113 | } | |
114 | ||
26971737 VP |
115 | if (!empty($_POST['tklch'])) |
116 | foreach ($_POST as $key => $value) { | |
117 | foreach ($value as $tok) { | |
118 | $tok = explode(",", $tok); | |
17311eb0 BM |
119 | $ban = base64_decode($tok[0]); |
120 | $type = base64_decode($tok[1]); | |
121 | if ($rpc->serverban()->delete($ban, $type)) | |
122 | Message::Success("$type has been removed for $ban"); | |
123 | else | |
124 | Message::Fail("Unable to remove $type on $ban: $rpc->error"); | |
26971737 VP |
125 | } |
126 | } | |
127 | ||
128 | if (!empty($_POST['sf'])) | |
129 | foreach ($_POST as $key => $value) { | |
130 | foreach ($value as $tok) { | |
131 | $tok = explode(",", $tok); | |
17311eb0 BM |
132 | $name = base64_decode($tok[0]); |
133 | $match_type = base64_decode($tok[1]); | |
134 | $spamfilter_targets = base64_decode($tok[2]); | |
135 | $ban_action = base64_decode($tok[3]); | |
136 | if ($rpc->spamfilter()->delete($name, $match_type, $spamfilter_targets, $ban_action)) | |
137 | Message::Success("Spamfilter on $name has been removed"); | |
138 | else | |
139 | Message::Fail("Unable to remove spamfilter on $name: $rpc->error"); | |
26971737 VP |
140 | } |
141 | } | |
142 | } | |
143 | ||
b063b4b2 | 144 | rpc_pop_lists(); |
709b97f3 | 145 | ?> |
82f5bcbf VP |
146 | |
147 | <div class="tab-content\"> | |
148 | <div id="overview" data-tab-content class="active"> | |
896b6cdc VP |
149 | <table class='unrealircd_overview'> |
150 | <th>Chat Overview</th><th></th> | |
151 | <tr><td><b>Users</b></td><td><?php echo count(RPC_List::$user); ?></td></tr> | |
152 | <tr><td><b>Opers</b></td><td><?php echo RPC_List::$opercount; ?></td></tr> | |
153 | <tr><td><b>Services</b></td><td><?php echo RPC_List::$services_count; ?></td></tr> | |
154 | <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> | |
155 | <tr><td><b>Channels</b></td><td><?php echo count(RPC_List::$channel); ?></td></tr> | |
156 | <tr><td><b>Server bans</b></td><td><?php echo count(RPC_List::$tkl); ?></td></tr> | |
157 | <tr><td><b>Spamfilter entries</b></td><td><?php echo count(RPC_List::$spamfilter); ?></td></tr></th> | |
158 | </table></div></div> | |
b3898fc7 | 159 | |
ef866d8c VP |
160 | <div class="tab-content\"> |
161 | <div id="Users" data-tab-content> | |
4d834e71 VP |
162 | <table class='users_filter'> |
163 | <th class="thuf">Filter by: </th> | |
164 | <th> | |
165 | <form action="" method="post"> | |
166 | Nick: <input name="uf_nick" id="uf_nick" type="text"> | |
167 | <input class="cute_button2" type="submit" value="Search"> | |
168 | </form> | |
169 | </th> | |
170 | <th> | |
171 | <form action="" method="post"> | |
172 | Hostname: <input name="uf_host" id="uf_host" type="text"> | |
173 | <input class="cute_button2" type="submit" value="Search"> | |
174 | </form> | |
175 | </th> | |
176 | <th> | |
177 | <form action="" method="post"> | |
178 | IP: <input name="uf_ip" id="uf_ip" type="text"> | |
179 | <input class="cute_button2" type="submit" value="Search"> | |
180 | </form> | |
181 | </th> | |
182 | <th class="thuffer"> | |
babf1a0e | 183 | <form action="" method="post"> |
4d834e71 VP |
184 | Account: <input name="uf_account" id="uf_account" type="text"> |
185 | <input class="cute_button2" type="submit" value="Search"> | |
186 | </form> | |
187 | </th> | |
188 | </form> | |
189 | </table> | |
190 | <?php | |
babf1a0e VP |
191 | if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick'])) |
192 | Message::Info("Listing users which match nick: \"" . $_POST['uf_nick'] . "\""); | |
193 | ||
194 | if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip'])) | |
f63cfca8 | 195 | Message::Info("Listing users which match IP: \"" . $_POST['uf_ip'] . "\""); |
babf1a0e VP |
196 | |
197 | if (isset($_POST['uf_host']) && strlen($_POST['uf_host'])) | |
198 | Message::Info("Listing users which match hostmask: \"" . $_POST['uf_host'] . "\""); | |
199 | ||
200 | if (isset($_POST['uf_account']) && strlen($_POST['uf_account'])) | |
201 | Message::Info("Listing users which match account: \"" . $_POST['uf_account'] . "\""); | |
202 | ||
4d834e71 | 203 | ?> |
896b6cdc | 204 | <table class='users_overview'> |
26971737 | 205 | <th><input type="checkbox" label='selectall' onClick="toggle_user(this)" />Select all</th> |
896b6cdc VP |
206 | <th>Nick</th> |
207 | <th>UID</th> | |
ef866d8c | 208 | <th>Host / IP</th> |
896b6cdc | 209 | <th>Account</th> |
02c4da66 | 210 | <th>Usermodes<a href="https://www.unrealircd.org/docs/User_modes" target="_blank">ℹ️</a></th> |
896b6cdc VP |
211 | <th>Oper</th> |
212 | <th>Secure</th> | |
213 | <th>Connected to</th> | |
02c4da66 | 214 | <th>Reputation <a href="https://www.unrealircd.org/docs/Reputation_score" target="_blank">ℹ️</a></th> |
896b6cdc | 215 | |
b3898fc7 | 216 | <form action="" method="post"> |
896b6cdc VP |
217 | <?php |
218 | foreach(RPC_List::$user as $user) | |
219 | { | |
4d834e71 | 220 | |
babf1a0e | 221 | /* Some basic filtering for NICK */ |
4d834e71 | 222 | if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']) && |
03ddd26b BM |
223 | strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) !== 0 && |
224 | strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) == false) | |
4d834e71 VP |
225 | continue; |
226 | ||
babf1a0e VP |
227 | /* Some basic filtering for HOST */ |
228 | if (isset($_POST['uf_host']) && strlen($_POST['uf_host']) && | |
03ddd26b BM |
229 | strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) !== 0 && |
230 | strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) == false) | |
babf1a0e VP |
231 | continue; |
232 | ||
233 | /* Some basic filtering for IP */ | |
234 | if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']) && | |
03ddd26b BM |
235 | strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) !== 0 && |
236 | strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) == false) | |
babf1a0e VP |
237 | continue; |
238 | ||
239 | /* Some basic filtering for ACCOUNT */ | |
240 | if (isset($_POST['uf_account']) && strlen($_POST['uf_account']) && | |
03ddd26b BM |
241 | strpos(strtolower($user->user->account), strtolower($_POST['uf_account'])) !== 0 && |
242 | strpos(strtolower($user->user->account), strtolower($_POST['uf_account'])) == false) | |
babf1a0e VP |
243 | continue; |
244 | ||
896b6cdc | 245 | echo "<tr>"; |
03ddd26b BM |
246 | echo "<td><input type=\"checkbox\" value='" . base64_encode($user->id)."' name=\"userch[]\"></td>"; |
247 | $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="label">Bot</span>' : ""; | |
248 | echo "<td>".$user->name.$isBot.'</td>'; | |
249 | echo "<td>".$user->id."</td>"; | |
250 | echo "<td>".$user->hostname." (".$user->ip.")</td>"; | |
bf5527b1 | 251 | $account = (isset($user->user->account)) ? $user->user->account : '<span class="label noaccount">None</span>'; |
896b6cdc | 252 | echo "<td>".$account."</td>"; |
03ddd26b | 253 | $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "<none>"; |
896b6cdc | 254 | echo "<td>".$modes."</td>"; |
bf5527b1 | 255 | $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." <span class=\"label operclass-label\">".$user->user->operclass."</span>" : ""; |
2494eefd | 256 | if (!strlen($oper)) |
03ddd26b | 257 | $oper = (strpos($user->user->modes, "S") !== false) ? '<span class="label secure-connection">Service</span>' : ""; |
896b6cdc | 258 | echo "<td>".$oper."</td>"; |
03ddd26b | 259 | $secure = (isset($user->tls)) ? "<span class=\"label secure-connection\">Secure</span>" : "<span class=\"label noaccount\">Insecure</span>"; |
896b6cdc | 260 | echo "<td>".$secure."</td>"; |
03ddd26b BM |
261 | echo "<td>".$user->user->servername."</td>"; |
262 | echo "<td>".$user->user->reputation."</td>"; | |
896b6cdc | 263 | } |
26971737 | 264 | ?></table> |
1d7e7ff8 | 265 | <label for="bantype">Apply action: </label><br> |
26971737 VP |
266 | <select name="bantype" id="bantype"> |
267 | <option value=""></option> | |
268 | <optgroup label="Bans"> | |
269 | <option value="gline">GLine</option> | |
270 | <option value="gzline">GZLine</option> | |
271 | </optgroup> | |
272 | </select> | |
273 | <br> | |
1d7e7ff8 | 274 | <label for="banlen_w">Duration: </label><br> |
26971737 VP |
275 | <select name="banlen_w" id="banlen_w"> |
276 | <?php | |
277 | for ($i = 0; $i <= 56; $i++) | |
278 | { | |
279 | if (!$i) | |
280 | echo "<option value=\"0w\"></option>"; | |
281 | else | |
282 | { | |
283 | $w = ($i == 1) ? "week" : "weeks"; | |
284 | echo "<option value=\"$i" . "w\">$i $w" . "</option>"; | |
285 | } | |
286 | } | |
287 | ?> | |
288 | </select> | |
289 | <select name="banlen_d" id="banlen_d"> | |
290 | <?php | |
291 | for ($i = 0; $i <= 31; $i++) | |
292 | { | |
293 | if (!$i) | |
294 | echo "<option value=\"0d\"></option>"; | |
295 | else | |
296 | { | |
297 | $d = ($i == 1) ? "day" : "days"; | |
298 | echo "<option value=\"$i" . "d\">$i $d" . "</option>"; | |
299 | } | |
300 | } | |
301 | ?> | |
302 | </select> | |
303 | <select name="banlen_h" id="banlen_h"> | |
304 | <?php | |
305 | for ($i = 0; $i <= 24; $i++) | |
306 | { | |
307 | if (!$i) | |
308 | echo "<option value=\"0d\"></option>"; | |
309 | else | |
310 | { | |
311 | $h = ($i == 1) ? "hour" : "hours"; | |
312 | echo "<option value=\"$i" . "h\">$i $h" . "</option>"; | |
313 | } | |
314 | } | |
315 | ?> | |
316 | </select> | |
1d7e7ff8 VP |
317 | <br><label for="ban_reason">Reason:<br></label> |
318 | <textarea name="ban_reason" id="ban_reason">No reason</textarea><br> | |
319 | <input class="cute_button" type="submit" value="Apply"> | |
26971737 VP |
320 | </form> |
321 | ||
322 | </div></div> | |
82f5bcbf | 323 | |
ef866d8c VP |
324 | <div class="tab-content\"> |
325 | <div id="Channels" data-tab-content> | |
326 | <p></p> | |
327 | <table class='users_overview'> | |
328 | <th>Name</th> | |
329 | <th>Created</th> | |
330 | <th>User count</th> | |
331 | <th>Topic</th> | |
332 | <th>Topic Set</th> | |
333 | <th>Modes</th> | |
334 | ||
335 | <?php | |
336 | foreach(RPC_List::$channel as $channel) | |
337 | { | |
338 | echo "<tr>"; | |
03ddd26b BM |
339 | echo "<td>".$channel->name."</td>"; |
340 | echo "<td>".$channel->creation_time."</td>"; | |
341 | echo "<td>".$channel->num_users."</td>"; | |
342 | $topic = (isset($channel->topic)) ? $channel->topic : ""; | |
ef866d8c | 343 | echo "<td>".$topic."</td>"; |
03ddd26b | 344 | $setby = (isset($channel->topic)) ? "By ".$channel->topic_set_by .", at ".$channel->topic_set_at : ""; |
ef866d8c | 345 | echo "<td>".$setby."</td>"; |
03ddd26b | 346 | $modes = (isset($channel->modes)) ? "+" . $channel->modes : "<none>"; |
ef866d8c VP |
347 | echo "<td>".$modes."</td>"; |
348 | } | |
349 | ?></table></div></div> | |
350 | ||
351 | ||
352 | <div class="tab-content\"> | |
353 | <div id="TKL" data-tab-content> | |
35ccb286 VP |
354 | <div class="tkl_add_boxheader"> |
355 | Add Server Ban | |
356 | </div> | |
357 | <div class="tkl_add_form"> | |
358 | ||
359 | <form action="" method="post"> | |
360 | <div class="align_label">IP / Host:</div><input class="input_text" type="text" id="tkl_add" name="tkl_add"><br> | |
361 | <div class="align_label">Ban Type:</div><select name="bantype" id="bantype"> | |
362 | <option value=""></option> | |
363 | <optgroup label="Bans"> | |
364 | <option value="kline">Kill Line (KLine)</option> | |
365 | <option value="gline">Global Kill Line (GLine)</option> | |
366 | <option value="zline">Zap Line (ZLine)</option> | |
367 | <option value="gzline">Global Zap Line (GZLine)</option> | |
368 | ||
369 | </optgroup> | |
370 | <optgroup label="Restrictions"> | |
371 | <option value="local-qline">Reserve Nick Locally(QLine)</option> | |
372 | <option value="qline">Reserve Nick Globally (QLine)</option> | |
373 | <option value="shun">Shun</option> | |
374 | ||
375 | </optgroup> | |
376 | <optgroup label="Settings"> | |
377 | <option value="except">Global Exception (ELine)</option> | |
378 | <option value="local-exception">Local Exception (ELine)</option> | |
379 | </optgroup> | |
380 | </select><br> | |
381 | <div class="align_label"><label for="banlen_w">Duration: </label></div> | |
382 | <select name="banlen_w" id="banlen_w"> | |
383 | <?php | |
384 | for ($i = 0; $i <= 56; $i++) | |
385 | { | |
386 | if (!$i) | |
387 | echo "<option value=\"0w\"></option>"; | |
388 | else | |
389 | { | |
390 | $w = ($i == 1) ? "week" : "weeks"; | |
391 | echo "<option value=\"$i" . "w\">$i $w" . "</option>"; | |
392 | } | |
393 | } | |
394 | ?> | |
395 | </select> | |
396 | <select name="banlen_d" id="banlen_d"> | |
397 | <?php | |
398 | for ($i = 0; $i <= 31; $i++) | |
399 | { | |
400 | if (!$i) | |
401 | echo "<option value=\"0d\"></option>"; | |
402 | else | |
403 | { | |
404 | $d = ($i == 1) ? "day" : "days"; | |
405 | echo "<option value=\"$i" . "d\">$i $d" . "</option>"; | |
406 | } | |
407 | } | |
408 | ?> | |
409 | </select> | |
410 | <select name="banlen_h" id="banlen_h"> | |
411 | <?php | |
412 | for ($i = 0; $i <= 24; $i++) | |
413 | { | |
414 | if (!$i) | |
415 | echo "<option value=\"0d\"></option>"; | |
416 | else | |
417 | { | |
418 | $h = ($i == 1) ? "hour" : "hours"; | |
419 | echo "<option value=\"$i" . "h\">$i $h" . "</option>"; | |
420 | } | |
421 | } | |
422 | ?> | |
423 | </select> | |
424 | <br><div class="align_label"><label for="ban_reason">Reason: </label></div> | |
425 | <input class="input_text" type="text" id="ban_reason" name="ban_reason"><br> | |
426 | <div class="align_right_button_tkl_add"><input class="cute_button" type="submit" id="submit" value="Submit"></div> | |
427 | </form> | |
428 | </div> | |
ef866d8c | 429 | <table class='users_overview'> |
76200e36 | 430 | <form action="" method="post"> |
26971737 | 431 | <th><input type="checkbox" label='selectall' onClick="toggle_tkl(this)" />Select all</th> |
ef866d8c VP |
432 | <th>Mask</th> |
433 | <th>Type</th> | |
434 | <th>Set By</th> | |
435 | <th>Set On</th> | |
436 | <th>Expires</th> | |
437 | <th>Duration</th> | |
438 | <th>Reason</th> | |
439 | ||
440 | <?php | |
441 | foreach(RPC_List::$tkl as $tkl) | |
442 | { | |
443 | echo "<tr>"; | |
03ddd26b BM |
444 | echo "<td><input type=\"checkbox\" value='" . base64_encode($tkl->name).",".base64_encode($tkl->type) . "' name=\"tklch[]\"></td>"; |
445 | echo "<td>".$tkl->name."</td>"; | |
446 | echo "<td>".$tkl->type_string."</td>"; | |
447 | echo "<td>".$tkl->set_by."</td>"; | |
448 | echo "<td>".$tkl->set_at_string."</td>"; | |
449 | echo "<td>".$tkl->expire_at_string."</td>"; | |
450 | echo "<td>".$tkl->duration_string."</td>"; | |
451 | echo "<td>".$tkl->reason."</td>"; | |
ef866d8c | 452 | } |
76200e36 | 453 | ?></table><p><input class="cute_button" type="submit" value="Delete selected"></p></form></div></div> |
ef866d8c VP |
454 | |
455 | ||
456 | <div class="tab-content\"> | |
457 | <div id="Spamfilter" data-tab-content> | |
458 | <p></p> | |
459 | <table class='users_overview'> | |
26971737 VP |
460 | <form action="" method="post"> |
461 | <th><input type="checkbox" label='selectall' onClick="toggle_sf(this)" />Select all</th> | |
ef866d8c VP |
462 | <th>Mask</th> |
463 | <th>Type</th> | |
464 | <th>Set By</th> | |
465 | <th>Set On</th> | |
466 | <th>Expires</th> | |
467 | <th>Duration</th> | |
468 | <th>Match Type</th> | |
469 | <th>Action</th> | |
470 | <th>Action Duration</th> | |
471 | <th>Target</th> | |
472 | <th>Reason</th> | |
473 | ||
474 | <?php | |
475 | foreach(RPC_List::$spamfilter as $sf) | |
476 | { | |
477 | echo "<tr>"; | |
03ddd26b BM |
478 | 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>"; |
479 | echo "<td>".$sf->name."</td>"; | |
480 | echo "<td>".$sf->type_string."</td>"; | |
481 | echo "<td>".$sf->set_by."</td>"; | |
482 | echo "<td>".$sf->set_at_string."</td>"; | |
483 | echo "<td>".$sf->expire_at_string."</td>"; | |
484 | echo "<td>".$sf->duration_string."</td>"; | |
485 | echo "<td>".$sf->match_type."</td>"; | |
486 | echo "<td>".$sf->ban_action."</td>"; | |
487 | echo "<td>".$sf->ban_duration_string."</td>"; | |
488 | for ($i = 0, $targs = ""; $i < strlen($sf->spamfilter_targets); $i++) | |
ef866d8c | 489 | { |
03ddd26b | 490 | $c = $sf->spamfilter_targets[$i]; |
ef866d8c VP |
491 | if ($c == "c") |
492 | $targs .= "Channel, "; | |
493 | else if ($c == "p") | |
494 | $targs .= "Private,"; | |
495 | else if ($c == "n") | |
496 | $targs .= "Notice, "; | |
497 | else if ($c == "N") | |
498 | $targs .= "Channel notice, "; | |
499 | else if ($c == "P") | |
500 | $targs .= "Part message, "; | |
501 | else if ($c == "q") | |
502 | $targs .= "Quit message, "; | |
503 | else if ($c == "d") | |
504 | $targs .= "DCC filename, "; | |
505 | else if ($c == "a") | |
506 | $targs .= "Away message, "; | |
507 | else if ($c == "t") | |
508 | $targs .= "Channel topic, "; | |
509 | else if ($c == "T") | |
510 | $targs .= "MessageTag, "; | |
511 | else if ($c == "u") | |
512 | $targs .= "Usermask, "; | |
ef866d8c | 513 | } |
03ddd26b | 514 | $targs = rtrim($targs,", "); |
ef866d8c | 515 | echo "<td>".$targs."</td>"; |
03ddd26b | 516 | echo "<td>".$sf->reason."</td>"; |
ef866d8c VP |
517 | |
518 | } | |
26971737 VP |
519 | ?></table><p><input class="cute_button" type="submit" value="Delete selected"></p></form></div></div> |
520 | ||
521 | ||
522 | ||
523 | <div class="tab-content\"> | |
524 | <div id="News" data-tab-content> | |
525 | <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> | |
526 | <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> | |
527 | </div></div> | |
ef866d8c | 528 | |
896b6cdc | 529 | </body> |