]>
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)) { |
2fba9a82 VP |
29 | |
30 | if ($sf = $_POST['sf_add']) // if it was a spamfilter entry | |
31 | { | |
32 | /* get targets */ | |
33 | $targets = []; // empty arrae | |
34 | foreach($_POST as $key => $value) | |
35 | { | |
36 | if (substr($key, 0, 7) == "target_") | |
37 | $targets[] = str_replace(["target_", "_"], ["", "-"], $key); | |
38 | } | |
39 | if (empty($targets)) | |
40 | Message::Fail("No target was specified"); | |
41 | ||
42 | if (!isset($_POST['sf_bantype'])) | |
43 | Message::Fail("No action was chosen"); | |
44 | ||
45 | else | |
46 | { | |
47 | ||
48 | $bantype = $_POST['sf_bantype']; | |
49 | $targ_chars = ""; | |
50 | foreach($targets as $targ) | |
51 | { | |
52 | switch ($targ) { | |
53 | case "channel": | |
54 | $targ_chars .= "c"; | |
55 | break; | |
56 | case "private": | |
57 | $targ_chars .= "p"; | |
58 | break; | |
59 | case "channel-notice": | |
60 | $targ_chars .= "N"; | |
61 | break; | |
62 | case "private-notice": | |
63 | $targ_chars .= "n"; | |
64 | break; | |
65 | case "part": | |
66 | $targ_chars .= "P"; | |
67 | break; | |
68 | case "quit": | |
69 | $targ_chars .= "q"; | |
70 | break; | |
71 | case "dcc": | |
72 | $targ_chars .= "d"; | |
73 | break; | |
74 | case "away": | |
75 | $targ_chars .= "a"; | |
76 | break; | |
77 | case "topic": | |
78 | $targ_chars .= "t"; | |
79 | break; | |
80 | case "messagetag": | |
81 | $targ_chars .= "T"; | |
82 | break; | |
83 | case "user": | |
84 | $targ_chars .= "u"; | |
85 | break; | |
86 | } | |
87 | } | |
88 | /* duplicate code for now [= */ | |
89 | $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; | |
90 | $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; | |
91 | $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL; | |
92 | $duration = ""; | |
93 | if (!$banlen_d && !$banlen_h && !$banlen_w) | |
94 | $duration .= "0"; | |
95 | ||
96 | else | |
97 | { | |
98 | if ($banlen_w) | |
99 | $duration .= $banlen_w; | |
100 | if ($banlen_d) | |
101 | $duration .= $banlen_d; | |
102 | if ($banlen_h) | |
103 | $duration .= $banlen_h; | |
104 | } | |
105 | $match_type = $_POST['matchtype']; // should default to 'simple' | |
106 | $reason = isset($_POST['ban_reason']) ? $_POST['ban_reason'] : "No reason"; | |
107 | $soft = (isset($_POST['soft'])) ? true : false; | |
108 | if ($soft) | |
109 | $targ_chars = "%" . $targ_chars; | |
110 | if ($rpc->spamfilter()->add($sf, $match_type, $targ_chars, $bantype, $duration, $reason)) | |
111 | Message::Success("Added spamfilter entry \"$sf\" [match type: $match_type] [targets: $targ_chars] [reason: $reason]"); | |
112 | else | |
113 | Message::Fail("Could not add spamfilter entry \"$sf\" [match type: $match_type] [targets: $targ_chars] [reason: $reason]: $rpc->error"); | |
114 | } | |
115 | ||
116 | } | |
117 | ||
118 | else if (!($bantype = $_POST['bantype'])) // if it was a ban entry | |
4a0980ad VP |
119 | { |
120 | } | |
121 | else if (!($users = $_POST["userch"])) | |
122 | { | |
123 | /* check if this came from our Server Bans tab. */ | |
124 | if (!($iphost = $_POST['tkl_add'])) | |
125 | Message::Fail("No user was specified"); | |
26971737 | 126 | |
4a0980ad VP |
127 | else /* It did */ |
128 | { | |
dc961139 VP |
129 | if (( |
130 | $bantype == "gline" || | |
131 | $bantype == "gzline" || | |
132 | $bantype == "shun" || | |
133 | $bantype == "eline" | |
134 | ) && strpos($iphost, "@") == false) // doesn't have full mask | |
4a0980ad | 135 | $iphost = "*@" . $iphost; |
dc961139 VP |
136 | |
137 | $soft = ($_POST['soft']) ? true : false; | |
138 | ||
139 | if ($soft) | |
140 | $iphost = "%" . $iphost; | |
4a0980ad VP |
141 | /* duplicate code for now [= */ |
142 | $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; | |
143 | $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; | |
144 | $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL; | |
145 | $duration = ""; | |
146 | if (!$banlen_d && !$banlen_h && !$banlen_w) | |
147 | $duration .= "0"; | |
148 | ||
149 | else | |
150 | { | |
151 | if ($banlen_w) | |
152 | $duration .= $banlen_w; | |
153 | if ($banlen_d) | |
154 | $duration .= $banlen_d; | |
155 | if ($banlen_h) | |
156 | $duration .= $banlen_h; | |
157 | } | |
158 | $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration); | |
159 | $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; | |
160 | if ($rpc->serverban()->add($iphost, $bantype, $duration, $reason)) | |
161 | { | |
162 | Message::Success("Host / IP: $iphost has been $bantype" . "d $msg_msg: $reason"); | |
163 | } | |
164 | else | |
dc961139 | 165 | Message::Fail("The $bantype against \"$iphost\" could not be added: $rpc->error"); |
4a0980ad VP |
166 | } |
167 | } | |
168 | else /* It came from the Users tab */ | |
169 | { | |
170 | foreach ($_POST["userch"] as $user) | |
171 | { | |
26971737 | 172 | $user = base64_decode($user); |
b063b4b2 | 173 | $bantype = (isset($_POST['bantype'])) ? $_POST['bantype'] : NULL; |
4a0980ad | 174 | if (!$bantype) /* shouldn't happen? */ |
b063b4b2 VP |
175 | { |
176 | Message::Fail("An error occured"); | |
177 | return; | |
178 | } | |
179 | $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL; | |
180 | $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL; | |
181 | $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL; | |
182 | ||
183 | $duration = ""; | |
184 | if (!$banlen_d && !$banlen_h && !$banlen_w) | |
185 | $duration .= "0"; | |
186 | ||
187 | else | |
188 | { | |
189 | if ($banlen_w) | |
190 | $duration .= $banlen_w; | |
191 | if ($banlen_d) | |
192 | $duration .= $banlen_d; | |
193 | if ($banlen_h) | |
194 | $duration .= $banlen_h; | |
195 | } | |
196 | ||
0d0013bb | 197 | $nick = $rpc->user()->get($user); |
b063b4b2 VP |
198 | if (!$nick) |
199 | { | |
200 | Message::Fail("Could not find that user. Maybe they disconnected after you clicked this?"); | |
201 | return; | |
202 | } | |
203 | ||
ffd01497 | 204 | $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration); |
b3898fc7 | 205 | $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason"; |
0d0013bb | 206 | if ($rpc->serverban()->add($user, $bantype, $duration, $reason)) |
b063b4b2 | 207 | { |
0d0013bb BM |
208 | $c = $nick->client; |
209 | Message::Success($c->name . " (*@".$c->hostname.") has been $bantype" . "d $msg_msg: $reason"); | |
b063b4b2 | 210 | } |
76200e36 VP |
211 | } |
212 | } | |
213 | ||
26971737 VP |
214 | if (!empty($_POST['tklch'])) |
215 | foreach ($_POST as $key => $value) { | |
216 | foreach ($value as $tok) { | |
217 | $tok = explode(",", $tok); | |
17311eb0 BM |
218 | $ban = base64_decode($tok[0]); |
219 | $type = base64_decode($tok[1]); | |
220 | if ($rpc->serverban()->delete($ban, $type)) | |
221 | Message::Success("$type has been removed for $ban"); | |
222 | else | |
223 | Message::Fail("Unable to remove $type on $ban: $rpc->error"); | |
26971737 VP |
224 | } |
225 | } | |
226 | ||
227 | if (!empty($_POST['sf'])) | |
228 | foreach ($_POST as $key => $value) { | |
229 | foreach ($value as $tok) { | |
230 | $tok = explode(",", $tok); | |
17311eb0 BM |
231 | $name = base64_decode($tok[0]); |
232 | $match_type = base64_decode($tok[1]); | |
233 | $spamfilter_targets = base64_decode($tok[2]); | |
234 | $ban_action = base64_decode($tok[3]); | |
235 | if ($rpc->spamfilter()->delete($name, $match_type, $spamfilter_targets, $ban_action)) | |
236 | Message::Success("Spamfilter on $name has been removed"); | |
237 | else | |
238 | Message::Fail("Unable to remove spamfilter on $name: $rpc->error"); | |
26971737 VP |
239 | } |
240 | } | |
241 | } | |
242 | ||
b063b4b2 | 243 | rpc_pop_lists(); |
709b97f3 | 244 | ?> |
82f5bcbf VP |
245 | |
246 | <div class="tab-content\"> | |
247 | <div id="overview" data-tab-content class="active"> | |
896b6cdc VP |
248 | <table class='unrealircd_overview'> |
249 | <th>Chat Overview</th><th></th> | |
250 | <tr><td><b>Users</b></td><td><?php echo count(RPC_List::$user); ?></td></tr> | |
251 | <tr><td><b>Opers</b></td><td><?php echo RPC_List::$opercount; ?></td></tr> | |
252 | <tr><td><b>Services</b></td><td><?php echo RPC_List::$services_count; ?></td></tr> | |
253 | <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> | |
254 | <tr><td><b>Channels</b></td><td><?php echo count(RPC_List::$channel); ?></td></tr> | |
255 | <tr><td><b>Server bans</b></td><td><?php echo count(RPC_List::$tkl); ?></td></tr> | |
256 | <tr><td><b>Spamfilter entries</b></td><td><?php echo count(RPC_List::$spamfilter); ?></td></tr></th> | |
257 | </table></div></div> | |
b3898fc7 | 258 | |
ef866d8c VP |
259 | <div class="tab-content\"> |
260 | <div id="Users" data-tab-content> | |
4d834e71 VP |
261 | <table class='users_filter'> |
262 | <th class="thuf">Filter by: </th> | |
263 | <th> | |
264 | <form action="" method="post"> | |
265 | Nick: <input name="uf_nick" id="uf_nick" type="text"> | |
266 | <input class="cute_button2" type="submit" value="Search"> | |
267 | </form> | |
268 | </th> | |
269 | <th> | |
270 | <form action="" method="post"> | |
271 | Hostname: <input name="uf_host" id="uf_host" type="text"> | |
272 | <input class="cute_button2" type="submit" value="Search"> | |
273 | </form> | |
274 | </th> | |
275 | <th> | |
276 | <form action="" method="post"> | |
277 | IP: <input name="uf_ip" id="uf_ip" type="text"> | |
278 | <input class="cute_button2" type="submit" value="Search"> | |
279 | </form> | |
280 | </th> | |
281 | <th class="thuffer"> | |
babf1a0e | 282 | <form action="" method="post"> |
4d834e71 VP |
283 | Account: <input name="uf_account" id="uf_account" type="text"> |
284 | <input class="cute_button2" type="submit" value="Search"> | |
285 | </form> | |
286 | </th> | |
287 | </form> | |
288 | </table> | |
289 | <?php | |
babf1a0e VP |
290 | if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick'])) |
291 | Message::Info("Listing users which match nick: \"" . $_POST['uf_nick'] . "\""); | |
292 | ||
293 | if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip'])) | |
f63cfca8 | 294 | Message::Info("Listing users which match IP: \"" . $_POST['uf_ip'] . "\""); |
babf1a0e VP |
295 | |
296 | if (isset($_POST['uf_host']) && strlen($_POST['uf_host'])) | |
297 | Message::Info("Listing users which match hostmask: \"" . $_POST['uf_host'] . "\""); | |
298 | ||
299 | if (isset($_POST['uf_account']) && strlen($_POST['uf_account'])) | |
300 | Message::Info("Listing users which match account: \"" . $_POST['uf_account'] . "\""); | |
301 | ||
4d834e71 | 302 | ?> |
896b6cdc | 303 | <table class='users_overview'> |
26971737 | 304 | <th><input type="checkbox" label='selectall' onClick="toggle_user(this)" />Select all</th> |
896b6cdc VP |
305 | <th>Nick</th> |
306 | <th>UID</th> | |
ef866d8c | 307 | <th>Host / IP</th> |
896b6cdc | 308 | <th>Account</th> |
02c4da66 | 309 | <th>Usermodes<a href="https://www.unrealircd.org/docs/User_modes" target="_blank">ℹ️</a></th> |
896b6cdc VP |
310 | <th>Oper</th> |
311 | <th>Secure</th> | |
312 | <th>Connected to</th> | |
02c4da66 | 313 | <th>Reputation <a href="https://www.unrealircd.org/docs/Reputation_score" target="_blank">ℹ️</a></th> |
896b6cdc | 314 | |
b3898fc7 | 315 | <form action="" method="post"> |
896b6cdc VP |
316 | <?php |
317 | foreach(RPC_List::$user as $user) | |
318 | { | |
4d834e71 | 319 | |
babf1a0e | 320 | /* Some basic filtering for NICK */ |
4d834e71 | 321 | if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']) && |
03ddd26b BM |
322 | strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) !== 0 && |
323 | strpos(strtolower($user->name), strtolower($_POST['uf_nick'])) == false) | |
4d834e71 VP |
324 | continue; |
325 | ||
babf1a0e VP |
326 | /* Some basic filtering for HOST */ |
327 | if (isset($_POST['uf_host']) && strlen($_POST['uf_host']) && | |
03ddd26b BM |
328 | strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) !== 0 && |
329 | strpos(strtolower($user->hostname), strtolower($_POST['uf_host'])) == false) | |
babf1a0e VP |
330 | continue; |
331 | ||
332 | /* Some basic filtering for IP */ | |
333 | if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']) && | |
03ddd26b BM |
334 | strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) !== 0 && |
335 | strpos(strtolower($user->ip), strtolower($_POST['uf_ip'])) == false) | |
babf1a0e VP |
336 | continue; |
337 | ||
338 | /* Some basic filtering for ACCOUNT */ | |
339 | if (isset($_POST['uf_account']) && strlen($_POST['uf_account']) && | |
03ddd26b BM |
340 | strpos(strtolower($user->user->account), strtolower($_POST['uf_account'])) !== 0 && |
341 | strpos(strtolower($user->user->account), strtolower($_POST['uf_account'])) == false) | |
babf1a0e VP |
342 | continue; |
343 | ||
896b6cdc | 344 | echo "<tr>"; |
03ddd26b BM |
345 | echo "<td><input type=\"checkbox\" value='" . base64_encode($user->id)."' name=\"userch[]\"></td>"; |
346 | $isBot = (strpos($user->user->modes, "B") !== false) ? ' <span class="label">Bot</span>' : ""; | |
347 | echo "<td>".$user->name.$isBot.'</td>'; | |
348 | echo "<td>".$user->id."</td>"; | |
349 | echo "<td>".$user->hostname." (".$user->ip.")</td>"; | |
3f487ee1 | 350 | $account = (isset($user->user->account)) ? $user->user->account : '<span class="label bluelabel ">None</span>'; |
896b6cdc | 351 | echo "<td>".$account."</td>"; |
03ddd26b | 352 | $modes = (isset($user->user->modes)) ? "+" . $user->user->modes : "<none>"; |
896b6cdc | 353 | echo "<td>".$modes."</td>"; |
bf5527b1 | 354 | $oper = (isset($user->user->operlogin)) ? $user->user->operlogin." <span class=\"label operclass-label\">".$user->user->operclass."</span>" : ""; |
2494eefd | 355 | if (!strlen($oper)) |
03ddd26b | 356 | $oper = (strpos($user->user->modes, "S") !== false) ? '<span class="label secure-connection">Service</span>' : ""; |
896b6cdc | 357 | echo "<td>".$oper."</td>"; |
3f487ee1 | 358 | $secure = (isset($user->tls)) ? "<span class=\"label secure-connection\">Secure</span>" : "<span class=\"label redlabel\">Insecure</span>"; |
896b6cdc | 359 | echo "<td>".$secure."</td>"; |
03ddd26b BM |
360 | echo "<td>".$user->user->servername."</td>"; |
361 | echo "<td>".$user->user->reputation."</td>"; | |
896b6cdc | 362 | } |
26971737 | 363 | ?></table> |
1d7e7ff8 | 364 | <label for="bantype">Apply action: </label><br> |
26971737 VP |
365 | <select name="bantype" id="bantype"> |
366 | <option value=""></option> | |
367 | <optgroup label="Bans"> | |
368 | <option value="gline">GLine</option> | |
369 | <option value="gzline">GZLine</option> | |
370 | </optgroup> | |
371 | </select> | |
372 | <br> | |
1d7e7ff8 | 373 | <label for="banlen_w">Duration: </label><br> |
26971737 VP |
374 | <select name="banlen_w" id="banlen_w"> |
375 | <?php | |
376 | for ($i = 0; $i <= 56; $i++) | |
377 | { | |
378 | if (!$i) | |
379 | echo "<option value=\"0w\"></option>"; | |
380 | else | |
381 | { | |
382 | $w = ($i == 1) ? "week" : "weeks"; | |
383 | echo "<option value=\"$i" . "w\">$i $w" . "</option>"; | |
384 | } | |
385 | } | |
386 | ?> | |
387 | </select> | |
388 | <select name="banlen_d" id="banlen_d"> | |
389 | <?php | |
390 | for ($i = 0; $i <= 31; $i++) | |
391 | { | |
392 | if (!$i) | |
393 | echo "<option value=\"0d\"></option>"; | |
394 | else | |
395 | { | |
396 | $d = ($i == 1) ? "day" : "days"; | |
397 | echo "<option value=\"$i" . "d\">$i $d" . "</option>"; | |
398 | } | |
399 | } | |
400 | ?> | |
401 | </select> | |
402 | <select name="banlen_h" id="banlen_h"> | |
403 | <?php | |
404 | for ($i = 0; $i <= 24; $i++) | |
405 | { | |
406 | if (!$i) | |
407 | echo "<option value=\"0d\"></option>"; | |
408 | else | |
409 | { | |
410 | $h = ($i == 1) ? "hour" : "hours"; | |
411 | echo "<option value=\"$i" . "h\">$i $h" . "</option>"; | |
412 | } | |
413 | } | |
414 | ?> | |
415 | </select> | |
1d7e7ff8 VP |
416 | <br><label for="ban_reason">Reason:<br></label> |
417 | <textarea name="ban_reason" id="ban_reason">No reason</textarea><br> | |
418 | <input class="cute_button" type="submit" value="Apply"> | |
26971737 VP |
419 | </form> |
420 | ||
421 | </div></div> | |
82f5bcbf | 422 | |
ef866d8c VP |
423 | <div class="tab-content\"> |
424 | <div id="Channels" data-tab-content> | |
425 | <p></p> | |
426 | <table class='users_overview'> | |
427 | <th>Name</th> | |
428 | <th>Created</th> | |
429 | <th>User count</th> | |
430 | <th>Topic</th> | |
431 | <th>Topic Set</th> | |
432 | <th>Modes</th> | |
433 | ||
434 | <?php | |
435 | foreach(RPC_List::$channel as $channel) | |
436 | { | |
437 | echo "<tr>"; | |
03ddd26b BM |
438 | echo "<td>".$channel->name."</td>"; |
439 | echo "<td>".$channel->creation_time."</td>"; | |
440 | echo "<td>".$channel->num_users."</td>"; | |
441 | $topic = (isset($channel->topic)) ? $channel->topic : ""; | |
ef866d8c | 442 | echo "<td>".$topic."</td>"; |
03ddd26b | 443 | $setby = (isset($channel->topic)) ? "By ".$channel->topic_set_by .", at ".$channel->topic_set_at : ""; |
ef866d8c | 444 | echo "<td>".$setby."</td>"; |
03ddd26b | 445 | $modes = (isset($channel->modes)) ? "+" . $channel->modes : "<none>"; |
ef866d8c VP |
446 | echo "<td>".$modes."</td>"; |
447 | } | |
448 | ?></table></div></div> | |
449 | ||
450 | ||
451 | <div class="tab-content\"> | |
452 | <div id="TKL" data-tab-content> | |
35ccb286 VP |
453 | <div class="tkl_add_boxheader"> |
454 | Add Server Ban | |
455 | </div> | |
456 | <div class="tkl_add_form"> | |
457 | ||
458 | <form action="" method="post"> | |
459 | <div class="align_label">IP / Host:</div><input class="input_text" type="text" id="tkl_add" name="tkl_add"><br> | |
460 | <div class="align_label">Ban Type:</div><select name="bantype" id="bantype"> | |
461 | <option value=""></option> | |
462 | <optgroup label="Bans"> | |
463 | <option value="kline">Kill Line (KLine)</option> | |
464 | <option value="gline">Global Kill Line (GLine)</option> | |
465 | <option value="zline">Zap Line (ZLine)</option> | |
466 | <option value="gzline">Global Zap Line (GZLine)</option> | |
467 | ||
468 | </optgroup> | |
469 | <optgroup label="Restrictions"> | |
470 | <option value="local-qline">Reserve Nick Locally(QLine)</option> | |
471 | <option value="qline">Reserve Nick Globally (QLine)</option> | |
472 | <option value="shun">Shun</option> | |
473 | ||
474 | </optgroup> | |
475 | <optgroup label="Settings"> | |
476 | <option value="except">Global Exception (ELine)</option> | |
477 | <option value="local-exception">Local Exception (ELine)</option> | |
478 | </optgroup> | |
479 | </select><br> | |
480 | <div class="align_label"><label for="banlen_w">Duration: </label></div> | |
481 | <select name="banlen_w" id="banlen_w"> | |
482 | <?php | |
483 | for ($i = 0; $i <= 56; $i++) | |
484 | { | |
485 | if (!$i) | |
486 | echo "<option value=\"0w\"></option>"; | |
487 | else | |
488 | { | |
489 | $w = ($i == 1) ? "week" : "weeks"; | |
490 | echo "<option value=\"$i" . "w\">$i $w" . "</option>"; | |
491 | } | |
492 | } | |
493 | ?> | |
494 | </select> | |
495 | <select name="banlen_d" id="banlen_d"> | |
496 | <?php | |
497 | for ($i = 0; $i <= 31; $i++) | |
498 | { | |
499 | if (!$i) | |
500 | echo "<option value=\"0d\"></option>"; | |
501 | else | |
502 | { | |
503 | $d = ($i == 1) ? "day" : "days"; | |
504 | echo "<option value=\"$i" . "d\">$i $d" . "</option>"; | |
505 | } | |
506 | } | |
507 | ?> | |
508 | </select> | |
509 | <select name="banlen_h" id="banlen_h"> | |
510 | <?php | |
511 | for ($i = 0; $i <= 24; $i++) | |
512 | { | |
513 | if (!$i) | |
514 | echo "<option value=\"0d\"></option>"; | |
515 | else | |
516 | { | |
517 | $h = ($i == 1) ? "hour" : "hours"; | |
518 | echo "<option value=\"$i" . "h\">$i $h" . "</option>"; | |
519 | } | |
520 | } | |
521 | ?> | |
522 | </select> | |
523 | <br><div class="align_label"><label for="ban_reason">Reason: </label></div> | |
524 | <input class="input_text" type="text" id="ban_reason" name="ban_reason"><br> | |
dc961139 | 525 | <input class="input_text" type="checkbox" id="soft" name="soft">Don't affect logged-in users (soft) |
35ccb286 VP |
526 | <div class="align_right_button_tkl_add"><input class="cute_button" type="submit" id="submit" value="Submit"></div> |
527 | </form> | |
528 | </div> | |
ef866d8c | 529 | <table class='users_overview'> |
76200e36 | 530 | <form action="" method="post"> |
26971737 | 531 | <th><input type="checkbox" label='selectall' onClick="toggle_tkl(this)" />Select all</th> |
ef866d8c VP |
532 | <th>Mask</th> |
533 | <th>Type</th> | |
534 | <th>Set By</th> | |
535 | <th>Set On</th> | |
536 | <th>Expires</th> | |
537 | <th>Duration</th> | |
538 | <th>Reason</th> | |
539 | ||
540 | <?php | |
541 | foreach(RPC_List::$tkl as $tkl) | |
542 | { | |
543 | echo "<tr>"; | |
03ddd26b BM |
544 | echo "<td><input type=\"checkbox\" value='" . base64_encode($tkl->name).",".base64_encode($tkl->type) . "' name=\"tklch[]\"></td>"; |
545 | echo "<td>".$tkl->name."</td>"; | |
546 | echo "<td>".$tkl->type_string."</td>"; | |
547 | echo "<td>".$tkl->set_by."</td>"; | |
548 | echo "<td>".$tkl->set_at_string."</td>"; | |
549 | echo "<td>".$tkl->expire_at_string."</td>"; | |
550 | echo "<td>".$tkl->duration_string."</td>"; | |
551 | echo "<td>".$tkl->reason."</td>"; | |
ef866d8c | 552 | } |
76200e36 | 553 | ?></table><p><input class="cute_button" type="submit" value="Delete selected"></p></form></div></div> |
ef866d8c VP |
554 | |
555 | ||
556 | <div class="tab-content\"> | |
557 | <div id="Spamfilter" data-tab-content> | |
558 | <p></p> | |
2fba9a82 VP |
559 | <div class="tkl_add_boxheader"> |
560 | Add Spamfilter Entry | |
561 | </div> | |
562 | <div class="tkl_add_form"> | |
563 | ||
564 | <form action="" method="post"> | |
565 | <div class="align_label">Entry: </div><input class="input_text" type="text" id="sf_add" name="sf_add"><br> | |
566 | <div class="align_label">MatchType: </div><select name="matchtype" id="matchtype"> | |
567 | <option value="simple">Simple</option> | |
568 | <option value="regex">Regular Expression</option> | |
569 | </select><br> | |
570 | <div class="align_label">Action: </div><select name="sf_bantype" id="sf_bantype"> | |
571 | <option value=""></option> | |
572 | <optgroup label="Bans"> | |
573 | <option value="kline">Kill Line (KLine)</option> | |
574 | <option value="gline">Global Kill Line (GLine)</option> | |
575 | <option value="zline">Zap Line (ZLine)</option> | |
576 | <option value="gzline">Global Zap Line (GZLine)</option> | |
577 | ||
578 | </optgroup> | |
579 | <optgroup label="Restrictions"> | |
580 | <option value="tempshun">Temporary Shun (Session only)</option> | |
581 | <option value="shun">Shun</option> | |
582 | <option value="block">Block</option> | |
583 | <option value="dccblock">DCC Block</option> | |
584 | <option value="viruschan">Send to "Virus Chan"</option> | |
585 | </optgroup> | |
586 | <optgroup label="Other"> | |
587 | <option value="warn">Warn the user</option> | |
588 | </optgroup> | |
589 | </select><br> | |
590 | ||
591 | <div class="align_label"><label for="banlen_w">Targets: </label></div> | |
592 | <input type="checkbox" class="input_text" id="target_channel" name="target_channel">Channel messages<br> | |
593 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_private" name="target_private">Private messages<br> | |
594 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_channel_notice" name="target_channel_notice">Channel notices<br> | |
595 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_private_notice" name="target_private_notice">Private notices<br> | |
596 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_part" name="target_part">Part reason<br> | |
597 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_dcc" name="target_dcc">DCC Filename<br> | |
598 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_away" name="target_away">Away messages<br> | |
599 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_topic" name="target_topic">Channel topic<br> | |
600 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_messagetag" name="target_messagetag">MessageTags<br> | |
601 | <div class="align_label"><label></label></div><input type="checkbox" class="input_text" id="target_user" name="target_user">Userhost (nick!user@host:realname)<br> | |
602 | <div class="align_label"><label for="banlen_w">Duration: </label></div> | |
603 | <select name="banlen_w" id="banlen_w"> | |
604 | <?php | |
605 | for ($i = 0; $i <= 56; $i++) | |
606 | { | |
607 | if (!$i) | |
608 | echo "<option value=\"0w\"></option>"; | |
609 | else | |
610 | { | |
611 | $w = ($i == 1) ? "week" : "weeks"; | |
612 | echo "<option value=\"$i" . "w\">$i $w" . "</option>"; | |
613 | } | |
614 | } | |
615 | ?> | |
616 | </select> | |
617 | <select name="banlen_d" id="banlen_d"> | |
618 | <?php | |
619 | for ($i = 0; $i <= 31; $i++) | |
620 | { | |
621 | if (!$i) | |
622 | echo "<option value=\"0d\"></option>"; | |
623 | else | |
624 | { | |
625 | $d = ($i == 1) ? "day" : "days"; | |
626 | echo "<option value=\"$i" . "d\">$i $d" . "</option>"; | |
627 | } | |
628 | } | |
629 | ?> | |
630 | </select> | |
631 | <select name="banlen_h" id="banlen_h"> | |
632 | <?php | |
633 | for ($i = 0; $i <= 24; $i++) | |
634 | { | |
635 | if (!$i) | |
636 | echo "<option value=\"0d\"></option>"; | |
637 | else | |
638 | { | |
639 | $h = ($i == 1) ? "hour" : "hours"; | |
640 | echo "<option value=\"$i" . "h\">$i $h" . "</option>"; | |
641 | } | |
642 | } | |
643 | ?> | |
644 | </select> | |
645 | <br><div class="align_label"><label for="ban_reason">Reason: </label></div> | |
646 | <input class="input_text" type="text" id="ban_reason" name="ban_reason"><br> | |
647 | <input class="input_text" type="checkbox" id="soft" name="soft">Don't affect logged-in users (soft) | |
648 | <div class="align_right_button_tkl_add"><input class="cute_button" type="submit" id="submit" value="Submit"></div> | |
649 | </form> | |
650 | </div> | |
ef866d8c | 651 | <table class='users_overview'> |
26971737 VP |
652 | <form action="" method="post"> |
653 | <th><input type="checkbox" label='selectall' onClick="toggle_sf(this)" />Select all</th> | |
ef866d8c VP |
654 | <th>Mask</th> |
655 | <th>Type</th> | |
656 | <th>Set By</th> | |
657 | <th>Set On</th> | |
658 | <th>Expires</th> | |
659 | <th>Duration</th> | |
660 | <th>Match Type</th> | |
661 | <th>Action</th> | |
662 | <th>Action Duration</th> | |
663 | <th>Target</th> | |
664 | <th>Reason</th> | |
665 | ||
666 | <?php | |
667 | foreach(RPC_List::$spamfilter as $sf) | |
668 | { | |
669 | echo "<tr>"; | |
03ddd26b BM |
670 | 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>"; |
671 | echo "<td>".$sf->name."</td>"; | |
672 | echo "<td>".$sf->type_string."</td>"; | |
673 | echo "<td>".$sf->set_by."</td>"; | |
674 | echo "<td>".$sf->set_at_string."</td>"; | |
675 | echo "<td>".$sf->expire_at_string."</td>"; | |
676 | echo "<td>".$sf->duration_string."</td>"; | |
677 | echo "<td>".$sf->match_type."</td>"; | |
678 | echo "<td>".$sf->ban_action."</td>"; | |
679 | echo "<td>".$sf->ban_duration_string."</td>"; | |
680 | for ($i = 0, $targs = ""; $i < strlen($sf->spamfilter_targets); $i++) | |
ef866d8c | 681 | { |
03ddd26b | 682 | $c = $sf->spamfilter_targets[$i]; |
ef866d8c VP |
683 | if ($c == "c") |
684 | $targs .= "Channel, "; | |
685 | else if ($c == "p") | |
686 | $targs .= "Private,"; | |
687 | else if ($c == "n") | |
688 | $targs .= "Notice, "; | |
689 | else if ($c == "N") | |
690 | $targs .= "Channel notice, "; | |
691 | else if ($c == "P") | |
692 | $targs .= "Part message, "; | |
693 | else if ($c == "q") | |
694 | $targs .= "Quit message, "; | |
695 | else if ($c == "d") | |
696 | $targs .= "DCC filename, "; | |
697 | else if ($c == "a") | |
698 | $targs .= "Away message, "; | |
699 | else if ($c == "t") | |
700 | $targs .= "Channel topic, "; | |
701 | else if ($c == "T") | |
702 | $targs .= "MessageTag, "; | |
703 | else if ($c == "u") | |
704 | $targs .= "Usermask, "; | |
ef866d8c | 705 | } |
03ddd26b | 706 | $targs = rtrim($targs,", "); |
ef866d8c | 707 | echo "<td>".$targs."</td>"; |
03ddd26b | 708 | echo "<td>".$sf->reason."</td>"; |
ef866d8c VP |
709 | |
710 | } | |
26971737 VP |
711 | ?></table><p><input class="cute_button" type="submit" value="Delete selected"></p></form></div></div> |
712 | ||
713 | ||
714 | ||
715 | <div class="tab-content\"> | |
716 | <div id="News" data-tab-content> | |
717 | <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> | |
718 | <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> | |
719 | </div></div> | |
ef866d8c | 720 | |
896b6cdc | 721 | </body> |