]>
Commit | Line | Data |
---|---|---|
604aac30 | 1 | <?php |
c06c1713 BM |
2 | require_once "../inc/common.php"; |
3 | require_once "../inc/connection.php"; | |
4 | require_once "../inc/header.php"; | |
604aac30 | 5 | |
43a6787a VP |
6 | if ($uplink = $rpc->server()->get()) |
7 | IRCList::setmodes($uplink->server->features->chanmodes); | |
604aac30 VP |
8 | $title = "Channel Lookup"; |
9 | $channel = ""; | |
d9a581b9 | 10 | $channame = ""; |
604aac30 | 11 | $nick = NULL; |
b3c83a04 | 12 | $channelObj = NULL; |
4bc0dbc0 VP |
13 | |
14 | $can_edit = current_user_can(PERMISSION_EDIT_CHANNEL); | |
604aac30 | 15 | do_log($_GET); |
d9a581b9 | 16 | do_log($_POST); |
604aac30 VP |
17 | if (isset($_GET['chan'])) |
18 | { | |
19 | $channel = $_GET['chan']; | |
72e61f76 | 20 | $channelObj = $rpc->channel()->get($channel, 4); |
d9a581b9 | 21 | if (!$channelObj && strlen($channel)) |
604aac30 VP |
22 | { |
23 | Message::Fail("Could not find channel: \"$channel\""); | |
d9a581b9 VP |
24 | } elseif (strlen($channel)) { |
25 | ||
26 | $channame = $channelObj->name; | |
604aac30 | 27 | $title .= " for \"" . $channame . "\""; |
d9a581b9 | 28 | do_log($channelObj); |
604aac30 VP |
29 | } |
30 | } | |
b3c83a04 | 31 | $topicset = false; |
0b82418b VP |
32 | $del_ex = false; |
33 | $del_inv = false; | |
34 | $del_ban = false; | |
35 | $checkboxes = []; | |
04f90856 VP |
36 | |
37 | $chanban_errors = []; | |
72e61f76 | 38 | if (!empty($_POST)) |
b3c83a04 VP |
39 | { |
40 | if (isset($_POST['update_topic']) && isset($_POST['set_topic'])) | |
41 | { | |
42 | if (isset($channelObj)) | |
43 | { | |
0b82418b | 44 | if (!isset($channelObj->topic) || strcmp($channelObj->topic,$_POST['set_topic'])) // if the set topic is different |
b3c83a04 VP |
45 | { |
46 | $user = (function_exists('unreal_get_current_user') && $u = unreal_get_current_user()) ? $u->username : NULL; | |
47 | $topicset = $rpc->channel()->set_topic($channelObj->name, $_POST['set_topic'], $user); | |
48 | $channelObj->topic = $_POST['set_topic']; | |
49 | } | |
50 | } | |
51 | } | |
0b82418b VP |
52 | $checkboxes = (isset($_POST['ban_checkboxes'])) ? $_POST['ban_checkboxes'] : []; |
53 | if (isset($_POST['delete_sel_ex'])) | |
54 | { | |
55 | foreach($_POST['ce_checkboxes'] as $c) | |
56 | $checkboxes[] = $c; | |
e92763ac | 57 | do_delete_chanex($channelObj, $checkboxes); |
0b82418b | 58 | } |
e92763ac | 59 | if (isset($_POST['delete_sel_inv'])) |
0b82418b VP |
60 | { |
61 | foreach($_POST['ci_checkboxes'] as $c) | |
62 | $checkboxes[] = $c; | |
e92763ac | 63 | do_delete_invite($channelObj, $checkboxes); |
0b82418b VP |
64 | } |
65 | else if (isset($_POST['delete_sel_ban'])) | |
66 | { | |
67 | foreach($_POST['cb_checkboxes'] as $c) | |
68 | $checkboxes[] = $c; | |
e92763ac | 69 | do_delete_chanban($channelObj, $checkboxes); |
0b82418b | 70 | } |
185d5d5d | 71 | if (isset($_POST['add_chban']) || isset($_POST['add_chinv']) || isset($_POST['add_chex'])) |
04f90856 | 72 | { |
185d5d5d VP |
73 | |
74 | if (isset($_POST['add_chban'])) | |
75 | $mode = $_POST['add_chban']; | |
76 | else | |
77 | $mode = (isset($_POST['add_chinv'])) ? $_POST['add_chinv'] : $_POST['add_chex']; | |
78 | ||
04f90856 | 79 | $nick = (strlen($_POST['ban_nick'])) ? $_POST['ban_nick'] : false; |
785717b4 | 80 | $action_string = (isset($_POST['bantype_sel_action']) && strlen($_POST['bantype_sel_action'])) ? $_POST['bantype_sel_action'] : false; |
04f90856 VP |
81 | $action = ""; |
82 | $type_string = (strlen($_POST['bantype_sel_type'])) ? $_POST['bantype_sel_type'] : false; | |
83 | $type = ""; | |
84 | $expiry = (strlen($_POST['bantype_sel_ex'])) ? $_POST['bantype_sel_ex'] : false; | |
85 | $time = ""; | |
86 | ||
87 | if (!$nick) | |
88 | $chanban_errors[] = "You did not specify a nick/mask"; | |
89 | ||
90 | if ($action_string) | |
91 | { | |
92 | if (strstr($action_string,"Quiet")) | |
93 | $action = "~quiet:"; | |
94 | elseif (strstr($action_string,"Nick-change")) | |
95 | $action = "~nickchange:"; | |
96 | elseif (strstr($action_string,"Join")) | |
97 | $action = "~join:"; | |
98 | } | |
99 | if ($type_string) | |
100 | { | |
101 | if (strstr($type_string,"Account")) | |
102 | $type = "~account:"; | |
103 | elseif (strstr($type_string,"Channel")) | |
104 | $type = "~channel:"; | |
105 | elseif (strstr($type_string,"Country")) | |
106 | $type = "~country:"; | |
107 | elseif (strstr($type_string,"OperClass")) | |
108 | $type = "~operclass:"; | |
109 | elseif (strstr($type_string,"GECOS")) | |
110 | $type = "~realname:"; | |
111 | elseif (strstr($type_string,"Security")) | |
112 | $type = "~security-group:"; | |
113 | elseif (strstr($type_string,"Certificate")) | |
114 | $type = "~certfp:"; | |
115 | } | |
116 | if ($expiry) | |
117 | { | |
118 | $future = strtotime($expiry); | |
119 | $now = strtotime(date("Y-m-d h:i:s")); | |
120 | $ts = ($future - $now) / 60; | |
7431f178 | 121 | $ts = (int)$ts; |
04f90856 VP |
122 | $time = "~time:$ts:"; |
123 | if ($ts > 9999 || $ts < 1) | |
124 | $chanban_errors[] = "Cannot set expiry more than ".(9999 / 60)." hours (".(9999 / 1440)." days) in the future, or in the past"; | |
125 | } | |
126 | if (empty($chanban_errors)) | |
7431f178 VP |
127 | if ($rpc->channel()->set_mode($channel, "$mode", "$time$action$type$nick")) |
128 | Message::Success("The mode was set successfully: $mode $time$action$type$nick"); | |
7f6973d5 VP |
129 | |
130 | else | |
131 | foreach($chanban_errors as $err) | |
132 | Message::Fail($err); | |
04f90856 | 133 | } |
d2db68e3 VP |
134 | if ((isset($_POST['kickban']) || isset($_POST['muteban'])) && current_user_can(PERMISSION_EDIT_CHANNEL_USER)) |
135 | { | |
136 | $mute = (isset($_POST['muteban'])) ? true : false; | |
137 | $mutestr = ($mute) ? "~quiet:" : ""; | |
138 | $user = (!$mute) ? $_POST['kickban'] : $_POST['muteban']; | |
139 | ||
140 | $kbuser = $rpc->user()->get($user); | |
141 | ||
142 | if (!$kbuser) | |
143 | Message::Fail("Could not kickban user: User does not exist"); | |
144 | else | |
145 | { | |
146 | $rpc->channel()->set_mode($channelObj->name, "+b", "~time:".DEFAULT_CHAN_DETAIL_QUICK_ACTION_TIME.":".$mutestr."*!*@".$kbuser->user->cloakedhost); | |
147 | if (!$mute) | |
148 | $rpc->channel()->kick($channelObj->name, $kbuser->name, DEFAULT_CHAN_DETAIL_QUICK_BAN_REASON); | |
149 | ||
150 | $msgbox_str = ($mute) | |
151 | ? | |
152 | "User \"$kbuser->name\" has been muted for ".DEFAULT_CHAN_DETAIL_QUICK_ACTION_TIME." minutes." | |
153 | : | |
154 | "User \"$kbuser->name\" has been banned for ".DEFAULT_CHAN_DETAIL_QUICK_ACTION_TIME." minutes." | |
155 | ; | |
156 | Message::Success($msgbox_str); | |
157 | } | |
158 | } | |
ae7257d0 | 159 | |
4bc0dbc0 | 160 | if (isset($_POST['newmodes']) && isset($_POST['paramed_modes']) && $can_edit) |
ae7257d0 VP |
161 | { |
162 | $m = $_POST['newmodes']; | |
163 | $p = $_POST['paramed_modes']; | |
164 | ||
165 | do_log($p,$m); | |
166 | $addmodestring = "+"; | |
167 | $addparamstring = ""; | |
168 | $delmodestring = "-"; | |
169 | $delparamstring = ""; | |
170 | foreach ($m as $mode) | |
171 | { | |
172 | strcat($addmodestring, $mode); | |
173 | if (isset($p[$mode]) && strlen($p[$mode])) | |
174 | strcat($addparamstring, $p[$mode]." "); | |
175 | } | |
176 | ||
177 | $fmodes = $channelObj->modes; | |
178 | $tok = split($fmodes); | |
179 | $modes = $tok[0]; | |
180 | $params = rparv($fmodes); | |
181 | $paramed_modes = sort_paramed_modes($modes, $params); | |
182 | for ($i = 0; isset($modes[$i]) && $mode = $modes[$i]; $i++) | |
183 | { | |
184 | if (!strstr($addmodestring, $mode)) | |
185 | { | |
186 | $req = IRCList::lookup($mode)['requires']; | |
187 | if ($req == "Server") | |
188 | continue; | |
189 | strcat($delmodestring, $mode); | |
190 | $grp = get_chmode_group($mode); | |
191 | if ($grp == 2) | |
192 | strcat($delparamstring, $paramed_modes[$mode]." "); | |
193 | } | |
194 | ||
195 | } | |
196 | ||
197 | ||
198 | if ($rpc->channel()->set_mode($channel, $delmodestring.$addmodestring, $delparamstring." ".$addparamstring)) | |
199 | Message::Success("Channel settings have been successfully updated"); | |
200 | else | |
201 | Message::Fail("Could not change channel settings: $rpc->error"); | |
202 | } | |
203 | ||
72e61f76 BM |
204 | /* Re-grab the channel because of updates */ |
205 | $channelObj = $rpc->channel()->get($channel, 4); | |
b3c83a04 VP |
206 | } |
207 | ||
604aac30 VP |
208 | ?> |
209 | <title><?php echo $title; ?></title> | |
e92763ac | 210 | <h6><?php echo $title; ?></h6> |
d9a581b9 | 211 | |
785717b4 | 212 | |
785717b4 | 213 | <form method="get" action="details.php"> |
ae7257d0 | 214 | <div class="text-left input-group" style="width: 35%;"> |
e92763ac | 215 | <input class="form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>"> |
785717b4 VP |
216 | <div class="input-group-append"> |
217 | <button type="submit" class="btn btn-primary">Go</button> | |
218 | </div> | |
219 | </div> | |
785717b4 VP |
220 | </form> |
221 | <?php if (!$channelObj) | |
2d0fe151 VP |
222 | { |
223 | require_once("../inc/footer.php"); | |
224 | return; | |
225 | } | |
226 | ?> | |
785717b4 | 227 | |
04f90856 | 228 | <!-- Modal for Add Ban --> |
185d5d5d | 229 | <div class="modal fade" id="ban" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true"> |
04f90856 VP |
230 | <div class="modal-dialog modal-lg modal-dialog-centered" role="document"> |
231 | <div class="modal-content"> | |
232 | <div class="modal-header"> | |
233 | <h5 class="modal-title" id="myModalLabel">Add New Channel Ban</h5> | |
234 | <div type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
235 | <span aria-hidden="true">×</span> | |
236 | </div> | |
237 | </div> | |
238 | <div class="modal-body"> | |
239 | <form method="post"> | |
240 | <div class="input-group mb-3"> | |
241 | <label for="ban_nick">Mask | |
242 | <a href="https://www.unrealircd.org/docs/Extended_bans" target="__blank"><i class="fa fa-info-circle" aria-hidden="true" | |
243 | 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" | |
244 | ></i></a> | |
245 | <input style="width: 170%;" name="ban_nick" id="ban_nick" class="form-control curvy" type="text" | |
246 | placeholder="nick!user@host or something else" | |
247 | ></label> | |
248 | ||
249 | </div> | |
250 | <div class="input-group mb-3"> | |
251 | <label for="bantype_action">Ban Action | |
252 | <select class="form-control" name="bantype_sel_action" id="bantype_sel"> | |
253 | <option></option> | |
254 | <option>Quiet (Mute)</option> | |
255 | <option>Nick-change</option> | |
256 | <option>Join</option> | |
257 | </select> | |
258 | </label> | |
259 | </div> | |
260 | <div class="input-group mb-3"> | |
62ea846a | 261 | <label for="bantype_sel_type">Ban Type <small>Leave this blank for a "normal" ban</small> |
04f90856 VP |
262 | <select class="form-control" name="bantype_sel_type" id="bantype_sel_type"> |
263 | <option></option> | |
264 | <option>Match Account</option> | |
265 | <option>Match Channel</option> | |
266 | <option>Match Country</option> | |
267 | <option>Match OperClass</option> | |
268 | <option>Match RealName / GECOS</option> | |
269 | <option>Match Security Group</option> | |
270 | <option>Match Certificate Fingerprint</option> | |
271 | </select> | |
272 | </label> | |
273 | </div> | |
274 | <div class="input-group mb-3"> | |
275 | <label for="bantype_sel_ex">Expiry Date-Time <br><small>Leave blank to mean "Permanent"</small> | |
276 | <input type="datetime-local" name="bantype_sel_ex" id="bantype_sel_ex" class="form-control"> | |
277 | </label> | |
278 | </div> | |
279 | </div> | |
280 | <div class="modal-footer"> | |
281 | <input type="hidden" id="server" name="add_chban" value="b"></input> | |
282 | <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> | |
283 | <button type="submit" action="post" class="btn btn-danger">Add Channel Ban</button> | |
284 | </form> | |
285 | </div> | |
286 | </div> | |
287 | </div> | |
288 | </div> | |
289 | ||
290 | ||
185d5d5d VP |
291 | <!-- Modal for Add Invite --> |
292 | <div class="modal fade" id="invite" tabindex="-1" role="dialog" aria-labelledby="add_invite_modal" aria-hidden="true"> | |
04f90856 VP |
293 | <div class="modal-dialog modal-lg modal-dialog-centered" role="document"> |
294 | <div class="modal-content"> | |
295 | <div class="modal-header"> | |
185d5d5d VP |
296 | <h5 class="modal-title" id="add_invite_modal">Add New Channel Invite</h5> |
297 | <div type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
04f90856 | 298 | <span aria-hidden="true">×</span> |
185d5d5d | 299 | </div> |
04f90856 VP |
300 | </div> |
301 | <div class="modal-body"> | |
302 | <form method="post"> | |
303 | <div class="input-group mb-3"> | |
185d5d5d VP |
304 | <label for="ban_nick">Mask |
305 | <a href="https://www.unrealircd.org/docs/Extended_bans" target="__blank"><i class="fa fa-info-circle" aria-hidden="true" | |
306 | 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" | |
307 | ></i></a> | |
308 | <input style="width: 170%;" name="ban_nick" id="ban_nick" class="form-control curvy" type="text" | |
309 | placeholder="nick!user@host or something else" | |
310 | ></label> | |
311 | ||
04f90856 VP |
312 | </div> |
313 | <div class="input-group mb-3"> | |
185d5d5d VP |
314 | <label for="bantype_sel_type">Invite Type |
315 | <select class="form-control" name="bantype_sel_type" id="bantype_sel_type"> | |
316 | <option></option> | |
317 | <option>Match Account</option> | |
318 | <option>Match Channel</option> | |
319 | <option>Match Country</option> | |
320 | <option>Match OperClass</option> | |
321 | <option>Match RealName / GECOS</option> | |
322 | <option>Match Security Group</option> | |
323 | <option>Match Certificate Fingerprint</option> | |
324 | </select> | |
325 | </label> | |
326 | </div> | |
327 | <div class="input-group mb-3"> | |
328 | <label for="bantype_sel_ex">Expiry Date-Time <br><small>Leave blank to mean "Permanent"</small> | |
329 | <input type="datetime-local" name="bantype_sel_ex" id="bantype_sel_ex" class="form-control"> | |
330 | </label> | |
04f90856 | 331 | </div> |
185d5d5d VP |
332 | </div> |
333 | <div class="modal-footer"> | |
2dd2b837 | 334 | <input type="hidden" name="add_chinv" value="I"></input> |
185d5d5d | 335 | <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> |
2dd2b837 | 336 | <button type="submit" action="post" class="btn btn-danger">Add Invite</button> |
04f90856 VP |
337 | </form> |
338 | </div> | |
339 | </div> | |
340 | </div> | |
341 | </div> | |
342 | ||
185d5d5d | 343 | <!-- Modal for Add Ban Exceptions --> |
43a6787a | 344 | <div class="modal fade" id="except" tabindex="-1" role="dialog" aria-labelledby="except" aria-hidden="true"> |
185d5d5d VP |
345 | <div class="modal-dialog modal-lg modal-dialog-centered" role="document"> |
346 | <div class="modal-content"> | |
347 | <div class="modal-header"> | |
43a6787a | 348 | <h5 class="modal-title" >Add New Channel Ban Exception</h5> |
185d5d5d VP |
349 | <div type="button" class="close" data-dismiss="modal" aria-label="Close"> |
350 | <span aria-hidden="true">×</span> | |
351 | </div> | |
352 | </div> | |
353 | <div class="modal-body"> | |
354 | <form method="post"> | |
355 | <div class="input-group mb-3"> | |
356 | <label for="ban_nick">Mask | |
357 | <a href="https://www.unrealircd.org/docs/Extended_bans" target="__blank"><i class="fa fa-info-circle" aria-hidden="true" | |
358 | 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" | |
359 | ></i></a> | |
360 | <input style="width: 170%;" name="ban_nick" id="ban_nick" class="form-control curvy" type="text" | |
361 | placeholder="nick!user@host or something else" | |
362 | ></label> | |
363 | ||
364 | </div> | |
365 | <div class="input-group mb-3"> | |
366 | <label for="bantype_sel_type">Ban Type | |
367 | <select class="form-control" name="bantype_sel_type" id="bantype_sel_type"> | |
368 | <option></option> | |
369 | <option>Match Account</option> | |
370 | <option>Match Channel</option> | |
371 | <option>Match Country</option> | |
372 | <option>Match OperClass</option> | |
373 | <option>Match RealName / GECOS</option> | |
374 | <option>Match Security Group</option> | |
375 | <option>Match Certificate Fingerprint</option> | |
376 | </select> | |
377 | </label> | |
378 | </div> | |
379 | <div class="input-group mb-3"> | |
380 | <label for="bantype_sel_ex">Expiry Date-Time <br><small>Leave blank to mean "Permanent"</small> | |
381 | <input type="datetime-local" name="bantype_sel_ex" id="bantype_sel_ex" class="form-control"> | |
382 | </label> | |
383 | </div> | |
384 | </div> | |
385 | <div class="modal-footer"> | |
386 | <input type="hidden" id="server" name="add_chex" value="e"></input> | |
387 | <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> | |
388 | <button type="submit" action="post" class="btn btn-danger">Add Exception</button> | |
389 | </form> | |
390 | </div> | |
391 | </div> | |
392 | </div> | |
393 | </div> | |
185d5d5d | 394 | |
43a6787a VP |
395 | <!-- Modal for Edit Channel Modes --> |
396 | <div class="modal fade" id="editchmodes" tabindex="-1" role="dialog" aria-labelledby="editchmodes" aria-hidden="true"> | |
397 | <div class="modal-dialog modal-dialog-centered" role="document"> | |
398 | <div class="modal-content"> | |
399 | <div class="modal-header"> | |
400 | <h5 class="modal-title" id="editchmodes">Edit Channel Modes</h5> | |
401 | <div type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
402 | <span aria-hidden="true">×</span> | |
403 | </div> | |
404 | </div> | |
405 | <div class="modal-body"> | |
406 | <form method="post"> | |
43a6787a | 407 | <?php generate_edit_chmodes($channelObj); ?> |
43a6787a VP |
408 | <input type="hidden" id="server" name="add_chex" value="e"></input> |
409 | <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> | |
410 | <button type="submit" action="post" class="btn btn-danger">Update</button> | |
411 | </form> | |
412 | </div> | |
413 | </div> | |
414 | </div> | |
415 | </div> | |
416 | ||
185d5d5d | 417 | <br> |
e92763ac VP |
418 | <h6> |
419 | Topic:<br></h6> | |
185d5d5d VP |
420 | <form method="post" action="details.php?chan=<?php echo urlencode($channelObj->name); ?>"> |
421 | <div class="input-group"> | |
422 | <input maxlength="360" type="text" class="input-group form-control" name="set_topic" value="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>"> | |
423 | <div class="input-group-append"><button type="submit" name="update_topic" value="true" class="btn btn-info">Update Topic</button></div></div> | |
424 | </form> | |
425 | <?php | |
426 | if ($topicset) | |
427 | Message::Success("The topic for $channelObj->name has been updated to be: \"".htmlspecialchars($channelObj->topic)."\""); | |
428 | ?> | |
429 | <br> | |
d2db68e3 VP |
430 | |
431 | <!-- Modal for User Action --> | |
432 | <div class="modal fade" id="useraction" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true"> | |
433 | <div class="modal-dialog modal-lg modal-dialog-centered" role="document"> | |
434 | <div class="modal-content"> | |
435 | <div class="modal-header"> | |
436 | <h5 class="modal-title" id="myModalLabel">Add New Channel Ban</h5> | |
437 | <div type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
438 | <span aria-hidden="true">×</span> | |
439 | </div> | |
440 | </div> | |
441 | <div class="modal-body"> | |
442 | <form method="post"> | |
443 | <div class="input-group mb-3"> | |
444 | <label for="ban_nick">Mask | |
445 | <a href="https://www.unrealircd.org/docs/Extended_bans" target="__blank"><i class="fa fa-info-circle" aria-hidden="true" | |
446 | 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" | |
447 | ></i></a> | |
448 | <input style="width: 170%;" name="ban_nick" id="ban_nick" class="form-control curvy" type="text" | |
449 | placeholder="nick!user@host or something else" | |
450 | ></label> | |
451 | ||
452 | </div> | |
453 | <div class="input-group mb-3"> | |
454 | <label for="bantype_action">Ban Action | |
455 | <select class="form-control" name="bantype_sel_action" id="bantype_sel"> | |
456 | <option></option> | |
457 | <option>Quiet (Mute)</option> | |
458 | <option>Nick-change</option> | |
459 | <option>Join</option> | |
460 | </select> | |
461 | </label> | |
462 | </div> | |
463 | <div class="input-group mb-3"> | |
464 | <label for="bantype_sel_type">Ban Type | |
465 | <select class="form-control" name="bantype_sel_type" id="bantype_sel_type"> | |
466 | <option></option> | |
467 | <option>Match Account</option> | |
468 | <option>Match Channel</option> | |
469 | <option>Match Country</option> | |
470 | <option>Match OperClass</option> | |
471 | <option>Match RealName / GECOS</option> | |
472 | <option>Match Security Group</option> | |
473 | <option>Match Certificate Fingerprint</option> | |
474 | </select> | |
475 | </label> | |
476 | </div> | |
477 | <div class="input-group mb-3"> | |
478 | <label for="bantype_sel_ex">Expiry Date-Time <br><small>Leave blank to mean "Permanent"</small> | |
479 | <input type="datetime-local" name="bantype_sel_ex" id="bantype_sel_ex" class="form-control"> | |
480 | </label> | |
481 | </div> | |
482 | </div> | |
483 | <div class="modal-footer"> | |
484 | <input type="hidden" id="server" name="add_chban" value="b"></input> | |
485 | <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> | |
486 | <button type="submit" action="post" class="btn btn-danger">Add Channel Ban</button> | |
487 | </form> | |
488 | </div> | |
489 | </div> | |
490 | </div> | |
491 | </div> | |
492 | ||
d9a581b9 | 493 | <div class="container-xxl"> |
d2db68e3 | 494 | <div class="row"> |
5adc2fad | 495 | <div class="col-sm-4"> |
d2db68e3 VP |
496 | <div class="card"> |
497 | <div class="card-body"> | |
e92763ac | 498 | <h6 class="card-title">User List</h6> |
d2db68e3 VP |
499 | <p class="card-text"><?php generate_chan_occupants_table($channelObj); ?></p> |
500 | </div> | |
501 | </div> | |
502 | </div> | |
5adc2fad | 503 | <div class="col-sm-8"> |
d2db68e3 VP |
504 | <div class="card"> |
505 | <div class="card-body"> | |
e92763ac VP |
506 | <h6 class="card-title">Channel Settings</h6> |
507 | <ul class="nav nav-tabs" role="tablist"> | |
508 | <li class="nav-item" role="presentation"><a class="nav-link" href="#chanmodes" aria-controls="chanmodes" role="tab" data-toggle="tab">Settings / Modes</a></li> | |
509 | <li class="nav-item" role="presentation"><a class="nav-link" href="#chanbans" aria-controls="chanbans" role="tab" data-toggle="tab">Bans</a></li> | |
510 | <li class="nav-item" role="presentation"><a class="nav-link" href="#chaninv" aria-controls="chaninv" role="tab" data-toggle="tab">Invites</a></li> | |
511 | <li class="nav-item" role="presentation"><a class="nav-link" href="#chanex" aria-controls="chanex" role="tab" data-toggle="tab">Excepts</a></li> | |
512 | </ul> | |
513 | ||
514 | <div class="tab-content"> | |
ae7257d0 VP |
515 | <br> |
516 | <div class="tab-pane fade in" id="chanmodes"> | |
4bc0dbc0 | 517 | <button id="editlol" class="btn btn-sm btn-primary" <?php echo ($can_edit) ? "" : "disabled"; ?>>Change Settings</button> |
43a6787a | 518 | <p class="card-text"><?php generate_html_chansettings($channelObj); ?></p> |
ae7257d0 VP |
519 | </div><form id="editchanmodes" method="post" name="editchanmodes"> |
520 | <div class="tab-pane" style="display: none" id="chanmodes_edit"> | |
521 | ||
522 | <div class="btn btn-sm btn-secondary" id="editchmodesbk">Go back</div> | |
523 | <button type="submit" class="btn btn-sm btn-primary">Save Changes</button> | |
524 | <p class="card-text"><?php generate_edit_chmodes($channelObj); ?></p> | |
525 | </form> | |
43a6787a VP |
526 | </div> |
527 | ||
ae7257d0 | 528 | <div class="tab-pane fade in" id="chanbans"> |
43a6787a VP |
529 | <p class="card-text"><?php generate_chanbans_table($channelObj); ?></p> |
530 | </div> | |
ae7257d0 | 531 | <div class="tab-pane fade in" id="chaninv"> |
43a6787a VP |
532 | <p class="card-text"><?php generate_chaninvites_table($channelObj); ?></p> |
533 | </div> | |
ae7257d0 | 534 | <div class="tab-pane fade in" id="chanex"> |
43a6787a VP |
535 | <p class="card-text"><?php generate_chanexcepts_table($channelObj); ?></p> |
536 | </div> | |
ae7257d0 | 537 | <div class="tab-pane fade in" id="chanmodes_edit"> |
43a6787a VP |
538 | <p class="card-text"><?php /* insert hacks here */ ?></p> |
539 | </div> | |
e92763ac VP |
540 | |
541 | </div> | |
d2db68e3 VP |
542 | </div> |
543 | </div> | |
544 | </div> | |
604aac30 | 545 | </div> |
e92763ac | 546 | <script> |
ae7257d0 VP |
547 | const toggleBtn = document.getElementById('editlol'); |
548 | const staticInfo = document.getElementById('chanmodes'); | |
549 | const options = document.getElementById('chanmodes_edit'); | |
550 | const backBtn = document.getElementById('editchmodesbk'); | |
551 | ||
552 | backBtn.addEventListener('click', function() { | |
553 | staticInfo.style.display = ''; | |
554 | options.style.display = 'none'; | |
555 | }); | |
556 | toggleBtn.addEventListener('click', function() { | |
557 | staticInfo.style.display = 'none'; | |
558 | options.style.display = ''; | |
559 | }); | |
560 | ||
e92763ac VP |
561 | // show dat first tab |
562 | $('.nav-tabs a[href="#chanmodes"]').tab('show') | |
563 | </script> | |
604aac30 | 564 | <?php |
c06c1713 | 565 | require_once("../inc/footer.php"); |
604aac30 | 566 |