- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="myModalLabel">Add new Server Ban</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
-
- <form method="post">
- <div class="align_label">IP / Host: </div> <input class="curvy" type="text" id="tkl_add" name="tkl_add"><br>
- <div class="align_label">Ban Type: </div> <select class="curvy" name="bantype" id="bantype">
- <option value=""></option>
- <optgroup label="Bans">
- <option value="kline">Kill Line (KLine)</option>
- <option value="gline">Global Kill Line (GLine)</option>
- <option value="zline">Zap Line (ZLine)</option>
- <option value="gzline">Global Zap Line (GZLine)</option>
-
- </optgroup>
- </select><br>
- <div class="align_label"><label for="banlen_w">Duration: </label></div>
- <select class="curvy" name="banlen_w" id="banlen_w">
- <?php
- for ($i = 0; $i <= 56; $i++)
- {
- if (!$i)
- echo "<option value=\"0w\"></option>";
- else
- {
- $w = ($i == 1) ? "week" : "weeks";
- echo "<option value=\"$i" . "w\">$i $w" . "</option>";
- }
- }
- ?>
- </select>
- <select class="curvy" name="banlen_d" id="banlen_d">
- <?php
- for ($i = 0; $i <= 31; $i++)
- {
- if (!$i)
- echo "<option value=\"0d\"></option>";
- else
- {
- $d = ($i == 1) ? "day" : "days";
- echo "<option value=\"$i" . "d\">$i $d" . "</option>";
- }
- }
- ?>
- </select>
- <select class="curvy" name="banlen_h" id="banlen_h">
- <?php
- for ($i = 0; $i <= 24; $i++)
- {
- if (!$i)
- echo "<option value=\"0d\"></option>";
- else
- {
- $h = ($i == 1) ? "hour" : "hours";
- echo "<option value=\"$i" . "h\">$i $h" . "</option>";
- }
- }
- ?>
- </select>
- <br><div class="align_label"><label for="ban_reason">Reason: </label></div>
- <input class="curvy input_text" type="text" id="ban_reason" name="ban_reason"><br>
- <input class="curvy input_text" type="checkbox" id="soft" name="soft">Don't affect logged-in users (soft)
-
+ <form id="ban_add_form" method="post">
+ <input name="edit_existing" type="hidden" id="edit_existing" value="">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="ban_add_title">Add server ban</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">×</span></button>
+ </div>
+ <div class="modal-body">
+ <div class="form-group">
+ <label for="ban_host" id="iphost_label">IP / Host</label>
+ <input name="ban_host" type="text" class="form-control" id="ban_host" aria-describedby="ban_host_help" value="" required>
+ <small id="ban_host_help" class="form-text text-muted">IP or host on which the ban is applied.</small>
+ </div>
+ <div class="form-group">
+ <label for="ban_type">Type</label><br>
+ <select class="curvy" name="ban_type" id="ban_type">
+ <option value=""></option>
+ <optgroup label="Bans">
+ <option value="kline">Local Kill (K-Line)</option>
+ <option value="gline">Global Kill (G-Line)</option>
+ <option value="zline">Local Z-Line</option>
+ <option value="gzline">Global Z-line</option>
+ </optgroup>
+ </select>
+ <small id="ban_type_help" class="form-text text-muted">Usually K-Line or G-Line. Use Z-Lines with care.</small>
+ </div>
+ <div class="form-group">
+ <input class="curvy input_text" type="checkbox" id="ban_soft" name="ban_soft"><label for="ban_soft">Soft-ban</label><br>
+ <small id="ban_soft_help" class="form-text text-muted">Ban does not affect logged in users</small>
+ </div>
+ <div class="form-group">
+ <label for="ban_duration">Duration</label>
+ <input name="ban_duration" type="text" class="form-control" id="ban_duration" aria-describedby="ban_duration_help" value="" placeholder="(empty means permanent ban)">
+ <small id="ban_duration_help" class="form-text text-muted">Duration of the ban in seconds, or in a format like 1d for 1 day. Leave empty for permanent ban</small>
+ </div>
+ <div class="form-group">
+ <label for="ban_reason">Reason</label>
+ <input name="ban_reason" type="text" class="form-control" id="ban_reason" aria-describedby="ban_reason_help" value="">
+ <small id="ban_reason_help" class="form-text text-muted">Reason of the ban (shown to the banned user)</small>
+ </div>
+ </div>
+
+ <div class="modal-footer">
+ <button id="CloseButton" type="button" id="cancel_add_ban" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
+ <button type="submit" name="do_add_ban" id="do_add_ban" class="btn btn-primary">Add Ban</button>
+ </div>