2 require_once "../common.php";
3 require_once "../header.php";
4 require_once "../misc/channel-lookup-misc.php";
6 $title = "Channel Lookup";
13 if (isset($_GET['chan']))
15 $channel = $_GET['chan'];
16 $channelObj = $rpc->channel()->get($channel);
17 if (!$channelObj && strlen($channel))
19 Message
::Fail("Could not find channel: \"$channel\"");
20 } elseif (strlen($channel)) {
22 $channame = $channelObj->name
;
23 $title .= " for \"" . $channame . "\"";
36 if (isset($_POST['update_topic']) && isset($_POST['set_topic']))
38 if (isset($channelObj))
40 if (!isset($channelObj->topic
) || strcmp($channelObj->topic
,$_POST['set_topic'])) // if the set topic is different
42 $user = (function_exists('unreal_get_current_user') && $u = unreal_get_current_user()) ? $u->username
: NULL;
43 $topicset = $rpc->channel()->set_topic($channelObj->name
, $_POST['set_topic'], $user);
44 $channelObj->topic
= $_POST['set_topic'];
48 $checkboxes = (isset($_POST['ban_checkboxes'])) ? $_POST['ban_checkboxes'] : [];
49 if (isset($_POST['delete_sel_ex']))
51 foreach($_POST['ce_checkboxes'] as $c)
54 chlkup_autoload_modal("excepts_modal");
56 else if (isset($_POST['delete_sel_inv']))
58 foreach($_POST['ci_checkboxes'] as $c)
61 chlkup_autoload_modal("invites_modal");
63 else if (isset($_POST['delete_sel_ban']))
65 foreach($_POST['cb_checkboxes'] as $c)
68 chlkup_autoload_modal("bans_modal");
70 if (isset($_POST['add_chban']) || isset($_POST['add_chinv']) || isset($_POST['add_chex']))
73 if (isset($_POST['add_chban']))
74 $mode = $_POST['add_chban'];
76 $mode = (isset($_POST['add_chinv'])) ? $_POST['add_chinv'] : $_POST['add_chex'];
78 $nick = (strlen($_POST['ban_nick'])) ? $_POST['ban_nick'] : false;
79 $action_string = (isset($_POST['bantype_sel_action']) && strlen($_POST['bantype_sel_action'])) ? $_POST['bantype_sel_action'] : false;
81 $type_string = (strlen($_POST['bantype_sel_type'])) ? $_POST['bantype_sel_type'] : false;
83 $expiry = (strlen($_POST['bantype_sel_ex'])) ? $_POST['bantype_sel_ex'] : false;
87 $chanban_errors[] = "You did not specify a nick/mask";
91 if (strstr($action_string,"Quiet"))
93 elseif (strstr($action_string,"Nick-change"))
94 $action = "~nickchange:";
95 elseif (strstr($action_string,"Join"))
100 if (strstr($type_string,"Account"))
102 elseif (strstr($type_string,"Channel"))
104 elseif (strstr($type_string,"Country"))
106 elseif (strstr($type_string,"OperClass"))
107 $type = "~operclass:";
108 elseif (strstr($type_string,"GECOS"))
109 $type = "~realname:";
110 elseif (strstr($type_string,"Security"))
111 $type = "~security-group:";
112 elseif (strstr($type_string,"Certificate"))
117 $future = strtotime($expiry);
118 $now = strtotime(date("Y-m-d h:i:s"));
119 $ts = ($future - $now) / 60;
121 $time = "~time:$ts:";
122 if ($ts > 9999 || $ts < 1)
123 $chanban_errors[] = "Cannot set expiry more than ".(9999 / 60)." hours (".(9999 / 1440)." days) in the future, or in the past";
125 if (empty($chanban_errors))
126 if ($rpc->channel()->set_mode($channel, "$mode", "$time$action$type$nick"))
127 Message
::Success("The mode was set successfully: $mode $time$action$type$nick");
130 foreach($chanban_errors as $err)
133 /* and finally re-grab the channel because updates lol */
134 $channelObj = $rpc->channel()->get($channel);
139 <title><?php echo $title; ?></title>
140 <h4><?php echo $title; ?></h4>
144 <div class="container
-xl
">
145 <form method="get
" action="details
.php
">
146 <div class="input
-group
">
147 <input class="form
-control
" id="chan
" name="chan
" type="text
" value="<?php
echo $channame; ?>">
148 <div class="input
-group
-append
">
149 <button type="submit
" class="btn btn
-primary
">Go</button>
154 <?php if (!$channelObj)
158 <!-- Modal for Channel Bans -->
159 <div class="modal fade
" id="bans_modal
" name="bans_modal
" tabindex="-1" role="dialog
" aria-labelledby="confirmModalCenterTitle
" aria-hidden="true">
160 <div class="modal
-dialog modal
-lg modal
-dialog
-centered
" role="document
">
161 <div class="modal
-content
">
162 <div class="modal
-header
">
163 <h5 class="modal
-title
" id="myModalLabel
">Channel Bans</h5>
164 <button type="button
" class="close
" data-dismiss="modal
" aria-label="Close
">
165 <span aria-hidden="true">×</span>
168 <div class="modal
-body
">
169 <?php if ($del_ban) do_delete_chanban($channelObj, $checkboxes); ?>
171 <?php generate_chanbans_table($channelObj); ?>
177 <!-- Modal for Channel Invited -->
178 <div class="modal fade
" id="invites_modal
" name="#invites_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
179 <div
class="modal-dialog modal-lg modal-dialog-centered" role
="document">
180 <div
class="modal-content">
181 <div
class="modal-header">
182 <h5
class="modal-title" id
="myModalLabel">Channel Invites
</h5
>
183 <button type
="button" class="close" data
-dismiss
="modal" aria
-label
="Close">
184 <span aria
-hidden
="true">×
;</span
>
187 <div
class="modal-body">
188 <?php
if ($del_inv) do_delete_invite($channelObj, $checkboxes); ?>
190 <?php
generate_chaninvites_table($channelObj); ?>
197 <!-- Modal
for Channel Exceptions
-->
198 <div
class="modal fade" id
="excepts_modal" tabindex
="-1" role
="dialog" aria
-labelledby
="confirmModalCenterTitle" aria
-hidden
="true">
199 <div
class="modal-dialog modal-lg modal-dialog-centered" role
="document">
200 <div
class="modal-content">
201 <div
class="modal-header">
202 <h5
class="modal-title" id
="myModalLabel">Channel Exceptions
</h5
>
203 <button type
="button" class="close" data
-dismiss
="modal" aria
-label
="Close">
204 <span aria
-hidden
="true">×
;</span
>
207 <div
class="modal-body">
208 <?php
if ($del_ex) do_delete_chanex($channelObj, $checkboxes); ?>
210 <?php
generate_chanexcepts_table($channelObj); ?>
218 <!-- Modal
for Add Ban
-->
219 <div
class="modal fade" id
="ban" tabindex
="-1" role
="dialog" aria
-labelledby
="confirmModalCenterTitle" aria
-hidden
="true">
220 <div
class="modal-dialog modal-lg modal-dialog-centered" role
="document">
221 <div
class="modal-content">
222 <div
class="modal-header">
223 <h5
class="modal-title" id
="myModalLabel">Add
New Channel Ban
</h5
>
224 <div type
="button" class="close" data
-dismiss
="modal" aria
-label
="Close">
225 <span aria
-hidden
="true">×
;</span
>
228 <div
class="modal-body">
230 <div
class="input-group mb-3">
231 <label
for="ban_nick">Mask
232 <a href
="https://www.unrealircd.org/docs/Extended_bans" target
="__blank"><i
class="fa fa-info-circle" aria
-hidden
="true"
233 title
="The mask or other value. For example if you are matching a country in 'Ban Type' then you would put the country code as this value. Click to view more information on Extended Bans"
235 <input style
="width: 170%;" name
="ban_nick" id
="ban_nick" class="form-control curvy" type
="text"
236 placeholder
="nick!user@host or something else"
240 <div
class="input-group mb-3">
241 <label
for="bantype_action">Ban Action
242 <select
class="form-control" name
="bantype_sel_action" id
="bantype_sel">
244 <option
>Quiet (Mute
)</option
>
245 <option
>Nick
-change
</option
>
246 <option
>Join
</option
>
250 <div
class="input-group mb-3">
251 <label
for="bantype_sel_type">Ban Type
252 <select
class="form-control" name
="bantype_sel_type" id
="bantype_sel_type">
254 <option
>Match Account
</option
>
255 <option
>Match Channel
</option
>
256 <option
>Match Country
</option
>
257 <option
>Match OperClass
</option
>
258 <option
>Match RealName
/ GECOS
</option
>
259 <option
>Match Security Group
</option
>
260 <option
>Match Certificate Fingerprint
</option
>
264 <div
class="input-group mb-3">
265 <label
for="bantype_sel_ex">Expiry Date
-Time
<br
><small
>Leave blank to mean
"Permanent"</small
>
266 <input type
="datetime-local" name
="bantype_sel_ex" id
="bantype_sel_ex" class="form-control">
270 <div
class="modal-footer">
271 <input type
="hidden" id
="server" name
="add_chban" value
="b"></input
>
272 <button id
="CloseButton" type
="button" class="btn btn-secondary" data
-dismiss
="modal">Cancel
</button
>
273 <button type
="submit" action
="post" class="btn btn-danger">Add Channel Ban
</button
>
281 <!-- Modal
for Add Invite
-->
282 <div
class="modal fade" id
="invite" tabindex
="-1" role
="dialog" aria
-labelledby
="add_invite_modal" aria
-hidden
="true">
283 <div
class="modal-dialog modal-lg modal-dialog-centered" role
="document">
284 <div
class="modal-content">
285 <div
class="modal-header">
286 <h5
class="modal-title" id
="add_invite_modal">Add
New Channel Invite
</h5
>
287 <div type
="button" class="close" data
-dismiss
="modal" aria
-label
="Close">
288 <span aria
-hidden
="true">×
;</span
>
291 <div
class="modal-body">
293 <div
class="input-group mb-3">
294 <label
for="ban_nick">Mask
295 <a href
="https://www.unrealircd.org/docs/Extended_bans" target
="__blank"><i
class="fa fa-info-circle" aria
-hidden
="true"
296 title
="The mask or other value. For example if you are matching a country in 'Invite Type' then you would put the country code as this value. Click to view more information on Extended Bans"
298 <input style
="width: 170%;" name
="ban_nick" id
="ban_nick" class="form-control curvy" type
="text"
299 placeholder
="nick!user@host or something else"
303 <div
class="input-group mb-3">
304 <label
for="bantype_sel_type">Invite Type
305 <select
class="form-control" name
="bantype_sel_type" id
="bantype_sel_type">
307 <option
>Match Account
</option
>
308 <option
>Match Channel
</option
>
309 <option
>Match Country
</option
>
310 <option
>Match OperClass
</option
>
311 <option
>Match RealName
/ GECOS
</option
>
312 <option
>Match Security Group
</option
>
313 <option
>Match Certificate Fingerprint
</option
>
317 <div
class="input-group mb-3">
318 <label
for="bantype_sel_ex">Expiry Date
-Time
<br
><small
>Leave blank to mean
"Permanent"</small
>
319 <input type
="datetime-local" name
="bantype_sel_ex" id
="bantype_sel_ex" class="form-control">
323 <div
class="modal-footer">
324 <input type
="hidden" name
="add_chinv" value
="e"></input
>
325 <button id
="CloseButton" type
="button" class="btn btn-secondary" data
-dismiss
="modal">Cancel
</button
>
326 <button type
="submit" action
="post" class="btn btn-danger">Add Channel Ban
</button
>
333 <!-- Modal
for Add Ban Exceptions
-->
334 <div
class="modal fade" id
="except" tabindex
="-1" role
="dialog" aria
-labelledby
="add_except_modal" aria
-hidden
="true">
335 <div
class="modal-dialog modal-lg modal-dialog-centered" role
="document">
336 <div
class="modal-content">
337 <div
class="modal-header">
338 <h5
class="modal-title" id
="add_except_modal">Add
New Channel Ban Exception
</h5
>
339 <div type
="button" class="close" data
-dismiss
="modal" aria
-label
="Close">
340 <span aria
-hidden
="true">×
;</span
>
343 <div
class="modal-body">
345 <div
class="input-group mb-3">
346 <label
for="ban_nick">Mask
347 <a href
="https://www.unrealircd.org/docs/Extended_bans" target
="__blank"><i
class="fa fa-info-circle" aria
-hidden
="true"
348 title
="The mask or other value. For example if you are matching a country in 'Ban Type' then you would put the country code as this value. Click to view more information on Extended Bans"
350 <input style
="width: 170%;" name
="ban_nick" id
="ban_nick" class="form-control curvy" type
="text"
351 placeholder
="nick!user@host or something else"
355 <div
class="input-group mb-3">
356 <label
for="bantype_sel_type">Ban Type
357 <select
class="form-control" name
="bantype_sel_type" id
="bantype_sel_type">
359 <option
>Match Account
</option
>
360 <option
>Match Channel
</option
>
361 <option
>Match Country
</option
>
362 <option
>Match OperClass
</option
>
363 <option
>Match RealName
/ GECOS
</option
>
364 <option
>Match Security Group
</option
>
365 <option
>Match Certificate Fingerprint
</option
>
369 <div
class="input-group mb-3">
370 <label
for="bantype_sel_ex">Expiry Date
-Time
<br
><small
>Leave blank to mean
"Permanent"</small
>
371 <input type
="datetime-local" name
="bantype_sel_ex" id
="bantype_sel_ex" class="form-control">
375 <div
class="modal-footer">
376 <input type
="hidden" id
="server" name
="add_chex" value
="e"></input
>
377 <button id
="CloseButton" type
="button" class="btn btn-secondary" data
-dismiss
="modal">Cancel
</button
>
378 <button type
="submit" action
="post" class="btn btn-danger">Add Exception
</button
>
388 <form method
="post" action
="details.php?chan=<?php echo urlencode($channelObj->name); ?>">
389 <div
class="input-group">
390 <input maxlength
="360" type
="text" class="input-group form-control" name
="set_topic" value
="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>">
391 <div
class="input-group-append"><button type
="submit" name
="update_topic" value
="true" class="btn btn-info">Update Topic
</button
></div
></div
>
395 Message
::Success("The topic for $channelObj->name has been updated to be: \"".htmlspecialchars($channelObj->topic
)."\"");
398 <div
class="row" style
="margin-left: 0px">
400 <button
class="btn btn-danger dropdown-toggle" data
-toggle
="dropdown" aria
-expanded
="false">Bans
</button
>
401 <div
class="dropdown-menu">
402 <div
class="dropdown-item" data
-toggle
="modal" data
-target
="#ban">Add
New</div
>
403 <div
class="dropdown-item" data
-toggle
="modal" data
-target
="#bans_modal">List</div
>
407 <button
class="btn btn-info dropdown-toggle" data
-toggle
="dropdown" aria
-expanded
="false">Invites
</button
>
408 <div
class="dropdown-menu">
409 <div
class="dropdown-item" data
-toggle
="modal" data
-target
="#invite">Add
New</div
>
410 <div
class="dropdown-item" data
-toggle
="modal" data
-target
="#invites_modal">List</div
>
414 <button
class="btn btn-warning dropdown-toggle" data
-toggle
="dropdown" aria
-expanded
="false">Excepts
</button
>
415 <div
class="dropdown-menu">
416 <div
class="dropdown-item" data
-toggle
="modal" data
-target
="#except">Add
New</div
>
417 <div
class="dropdown-item" data
-toggle
="modal" data
-target
="#excepts_modal">List</div
>
424 <div
class="container-xxl">
425 <div
class="accordion" id
="accordionExample">
427 <div
class="card-header" id
="headingOne">
429 <button
class="btn" type
="button" data
-toggle
="collapse" data
-target
="#collapseOne" aria
-expanded
="true" aria
-controls
="collapseOne">
435 <div id
="collapseOne" class="collapse show" aria
-labelledby
="headingOne" data
-parent
="#accordionExample">
436 <div
class="card-body">
437 <?php
generate_chan_occupants_table($channelObj); ?>
442 <div
class="card-header" id
="headingTwo">
444 <button
class="btn collapsed" type
="button" data
-toggle
="collapse" data
-target
="#collapseTwo" aria
-expanded
="false" aria
-controls
="collapseTwo">
445 Collapsible Group Item
#2
449 <div id
="collapseTwo" class="collapse" aria
-labelledby
="headingTwo" data
-parent
="#accordionExample">
450 <div
class="card-body">
451 Anim pariatur cliche reprehenderit
, enim eiusmod high life accusamus terry richardson ad squid
. 3 wolf moon officia aute
, non cupidatat skateboard dolor brunch
. Food truck quinoa nesciunt laborum eiusmod
. Brunch
3 wolf moon tempor
, sunt aliqua put a bird on it squid single
-origin coffee nulla assumenda shoreditch et
. Nihil anim keffiyeh helvetica
, craft beer labore wes anderson cred nesciunt sapiente ea proident
. Ad vegan excepteur butcher vice lomo
. Leggings occaecat craft beer farm
-to
-table
, raw denim aesthetic synth nesciunt you probably haven
't heard of them accusamus labore sustainable VHS.
456 <div class="card-header" id="headingThree">
458 <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
459 Collapsible Group Item #3
463 <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
464 <div class="card-body">
465 Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS
.
473 require_once("../footer.php");