]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - server-bans/ban-exceptions.php
Rather large update, please see commit notes
[irc/unrealircd/unrealircd-webpanel.git] / server-bans / ban-exceptions.php
1 <?php
2 require_once "../common.php";
3
4 require_once "../header.php";
5
6
7 $ban_exceptions = $rpc->serverbanexception()->getAll();
8
9 ?>
10 <h4>Ban Exceptions Overview</h4>
11 Here 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>
13
14 <p><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
15 Add entry
16 </button></p></table>
17 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
18 <div class="modal-dialog modal-dialog-centered" role="document">
19 <div class="modal-content">
20 <div class="modal-header">
21 <h5 class="modal-title" id="myModalLabel">Add new Name Ban</h5>
22 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
23 <span aria-hidden="true">&times;</span>
24 </button>
25 </div>
26 <div class="modal-body">
27
28 <form method="post">
29 <div class="align_label">Nick / Channel</div> <input class="curvy" type="text" id="tkl_add" name="tkl_add"><br>
30
31 <div class="align_label"><label for="banlen_w">Duration: </label></div>
32 <select class="curvy" name="banlen_w" id="banlen_w">
33 <?php
34 for ($i = 0; $i <= 56; $i++)
35 {
36 if (!$i)
37 echo "<option value=\"0w\"></option>";
38 else
39 {
40 $w = ($i == 1) ? "week" : "weeks";
41 echo "<option value=\"$i" . "w\">$i $w" . "</option>";
42 }
43 }
44 ?>
45 </select>
46 <select class="curvy" name="banlen_d" id="banlen_d">
47 <?php
48 for ($i = 0; $i <= 31; $i++)
49 {
50 if (!$i)
51 echo "<option value=\"0d\"></option>";
52 else
53 {
54 $d = ($i == 1) ? "day" : "days";
55 echo "<option value=\"$i" . "d\">$i $d" . "</option>";
56 }
57 }
58 ?>
59 </select>
60 <select class="curvy" name="banlen_h" id="banlen_h">
61 <?php
62 for ($i = 0; $i <= 24; $i++)
63 {
64 if (!$i)
65 echo "<option value=\"0d\"></option>";
66 else
67 {
68 $h = ($i == 1) ? "hour" : "hours";
69 echo "<option value=\"$i" . "h\">$i $h" . "</option>";
70 }
71 }
72 ?>
73 </select>
74 <br><div class="align_label"><label for="ban_reason">Reason: </label></div>
75 <input class="curvy input_text" type="text" id="ban_reason" name="ban_reason"><br>
76 <input class="curvy input_text" type="checkbox" id="soft" name="soft">Don't affect logged-in users (soft)
77
78 </div>
79
80 <div class="modal-footer">
81 <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
82 <button type="submit" action="post" class="btn btn-danger">Add Ban</button>
83 </form>
84 </div>
85 </div>
86 </div>
87 </div>
88
89 <table class="container-xxl table table-sm table-responsive caption-top table-striped">
90 <thead class="table-primary">
91 <form method="post">
92 <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_tkl(this)" /></th>
93 <th scope="col">Mask</th>
94 <th scope="col">Duration</th>
95 <th scope="col">Reason</th>
96 <th scope="col">Set By</th>
97 <th scope="col">Set On</th>
98 <th scope="col">Expires</th>
99 </thead>
100 <tbody>
101 <?php
102 foreach($ban_exceptions as $ban_exceptions)
103 {
104 $set_in_config = ((isset($ban_exceptions->set_in_config) && $ban_exceptions->set_in_config) || ($ban_exceptions->set_by == "-config-")) ? true : false;
105 echo "<tr scope='col'>";
106 if ($set_in_config)
107 echo "<td scope=\"col\"></td>";
108 else
109 echo "<td scope=\"col\"><input type=\"checkbox\" value='" . base64_encode($ban_exceptions->name).",".base64_encode($ban_exceptions->type) . "' name=\"tklch[]\"></td>";
110 echo "<td scope=\"col\">".$ban_exceptions->name."</td>";
111 echo "<td scope=\"col\">".$ban_exceptions->duration_string."</td>";
112 echo "<td scope=\"col\">".$ban_exceptions->reason."</td>";
113 $set_by = $set_in_config ? "<span class=\"badge rounded-pill badge-secondary\">Config</span>" : show_nick_only($ban_exceptions->set_by);
114 echo "<td scope=\"col\">".$set_by."</td>";
115 echo "<td scope=\"col\">".$ban_exceptions->set_at_string."</td>";
116 echo "<td scope=\"col\">".$ban_exceptions->expire_at_string."</td>";
117 echo "</tr>";
118 }
119 ?></tbody></table><p><button type="button" class="btn btn-danger" data-toggle="modal" data-target="#myModal2">
120 Delete selected
121 </button></p>
122 <div class="modal fade" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
123 <div class="modal-dialog modal-dialog-centered" role="document">
124 <div class="modal-content">
125 <div class="modal-header">
126 <h5 class="modal-title" id="myModalLabel">Confirm deletion</h5>
127 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
128 <span aria-hidden="true">&times;</span>
129 </button>
130 </div>
131 <div class="modal-body">
132 Are you sure you want to do this?<br>
133 This cannot be undone.
134 </div>
135 <div class="modal-footer">
136 <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
137 <button type="submit" action="post" class="btn btn-danger">Delete</button>
138
139 </div>
140 </div>
141 </div>
142 </div></form></div></div>
143
144 <?php require_once 'footer.php'; ?>