]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - server-bans/ban-exceptions.php
Overview buttons fully operational
[irc/unrealircd/unrealircd-webpanel.git] / server-bans / ban-exceptions.php
CommitLineData
33f512fa
VP
1<?php
2require_once "../common.php";
3
4require_once "../header.php";
5
6
7$ban_exceptions = $rpc->serverbanexception()->getAll();
8
9?>
10<h4>Ban Exceptions Overview</h4>
11Here is where you can make an exception to bans, that is, to make it so that the target mask is exempt from the ban types you specify.<br>
12<br>
33f512fa
VP
13<p><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
14 Add entry
15 </button></p></table>
16 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
9e2a2ac0 17 <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
33f512fa
VP
18 <div class="modal-content">
19 <div class="modal-header">
9e2a2ac0 20 <h5 class="modal-title" id="myModalLabel">Add new Ban Exception</h5>
33f512fa
VP
21 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
22 <span aria-hidden="true">&times;</span>
23 </button>
24 </div>
25 <div class="modal-body">
26
27 <form method="post">
9e2a2ac0
VP
28 <div class="align_label">IP / Mask</div> <input class="curvy" type="text" id="tkl_add" name="tkl_add"><br>
29 <div class="align_label">Exception Type: </div> <select multiple name="bantype" id="bantype" data-live-search="true">
30 <option value=""></option>
31
32 <option value="k">Kill Line (KLine)</option>
33 <option value="G">Global Kill Line (GLine)</option>
34 <option value="z">Zap Line (ZLine)</option>
35 <option value="Z">Global Zap Line (GZLine)</option>
36 <option value="Q">Reserve Nick Globally (QLine)</option>
37 <option value="s">Shun</option>
38 <option value="F">Spamfilter</option>
39 <option value="b">Blacklist</option>
40 <option value="c">Connect Flood</option>
41 <option value="d">Handshake Flood</option>
42 <option value="m">Max Per IP</option>
43 <option value="r">Anti-Random</option>
44 <option value="8">Anti-Mixed-UTF8</option>
45 <option value="v">Versions</option>
46 </select><br>
33f512fa
VP
47 <div class="align_label"><label for="banlen_w">Duration: </label></div>
48 <select class="curvy" name="banlen_w" id="banlen_w">
49 <?php
50 for ($i = 0; $i <= 56; $i++)
51 {
52 if (!$i)
53 echo "<option value=\"0w\"></option>";
54 else
55 {
56 $w = ($i == 1) ? "week" : "weeks";
57 echo "<option value=\"$i" . "w\">$i $w" . "</option>";
58 }
59 }
60 ?>
61 </select>
62 <select class="curvy" name="banlen_d" id="banlen_d">
63 <?php
64 for ($i = 0; $i <= 31; $i++)
65 {
66 if (!$i)
67 echo "<option value=\"0d\"></option>";
68 else
69 {
70 $d = ($i == 1) ? "day" : "days";
71 echo "<option value=\"$i" . "d\">$i $d" . "</option>";
72 }
73 }
74 ?>
75 </select>
76 <select class="curvy" name="banlen_h" id="banlen_h">
77 <?php
78 for ($i = 0; $i <= 24; $i++)
79 {
80 if (!$i)
81 echo "<option value=\"0d\"></option>";
82 else
83 {
84 $h = ($i == 1) ? "hour" : "hours";
85 echo "<option value=\"$i" . "h\">$i $h" . "</option>";
86 }
87 }
88 ?>
89 </select>
90 <br><div class="align_label"><label for="ban_reason">Reason: </label></div>
91 <input class="curvy input_text" type="text" id="ban_reason" name="ban_reason"><br>
92 <input class="curvy input_text" type="checkbox" id="soft" name="soft">Don't affect logged-in users (soft)
93
94 </div>
95
96 <div class="modal-footer">
97 <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
98 <button type="submit" action="post" class="btn btn-danger">Add Ban</button>
99 </form>
100 </div>
101 </div>
102 </div>
103 </div>
104
105 <table class="container-xxl table table-sm table-responsive caption-top table-striped">
106 <thead class="table-primary">
107 <form method="post">
108 <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_tkl(this)" /></th>
109 <th scope="col">Mask</th>
110 <th scope="col">Duration</th>
111 <th scope="col">Reason</th>
112 <th scope="col">Set By</th>
113 <th scope="col">Set On</th>
114 <th scope="col">Expires</th>
115 </thead>
116 <tbody>
117 <?php
118 foreach($ban_exceptions as $ban_exceptions)
119 {
120 $set_in_config = ((isset($ban_exceptions->set_in_config) && $ban_exceptions->set_in_config) || ($ban_exceptions->set_by == "-config-")) ? true : false;
121 echo "<tr scope='col'>";
122 if ($set_in_config)
123 echo "<td scope=\"col\"></td>";
124 else
125 echo "<td scope=\"col\"><input type=\"checkbox\" value='" . base64_encode($ban_exceptions->name).",".base64_encode($ban_exceptions->type) . "' name=\"tklch[]\"></td>";
126 echo "<td scope=\"col\">".$ban_exceptions->name."</td>";
127 echo "<td scope=\"col\">".$ban_exceptions->duration_string."</td>";
128 echo "<td scope=\"col\">".$ban_exceptions->reason."</td>";
129 $set_by = $set_in_config ? "<span class=\"badge rounded-pill badge-secondary\">Config</span>" : show_nick_only($ban_exceptions->set_by);
130 echo "<td scope=\"col\">".$set_by."</td>";
131 echo "<td scope=\"col\">".$ban_exceptions->set_at_string."</td>";
132 echo "<td scope=\"col\">".$ban_exceptions->expire_at_string."</td>";
133 echo "</tr>";
134 }
135 ?></tbody></table><p><button type="button" class="btn btn-danger" data-toggle="modal" data-target="#myModal2">
136 Delete selected
137 </button></p>
138 <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
139 <div class="modal-dialog modal-dialog-centered" role="document">
140 <div class="modal-content">
141 <div class="modal-header">
142 <h5 class="modal-title" id="myModalLabel">Confirm deletion</h5>
143 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
144 <span aria-hidden="true">&times;</span>
145 </button>
146 </div>
147 <div class="modal-body">
148 Are you sure you want to do this?<br>
149 This cannot be undone.
150 </div>
151 <div class="modal-footer">
152 <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
153 <button type="submit" action="post" class="btn btn-danger">Delete</button>
154
155 </div>
156 </div>
157 </div>
158 </div></form></div></div>
159
160<?php require_once 'footer.php'; ?>