162 lines
4.7 KiB
PHP
162 lines
4.7 KiB
PHP
<?php
|
|
//SECURE PAGE
|
|
session_start();
|
|
if (!isset( $_SESSION['user_id'] ) ) {
|
|
// Redirect them to the login page
|
|
header("Location: login.php");
|
|
}
|
|
?>
|
|
<?php
|
|
include('header.php');
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
//validate form
|
|
<!--
|
|
function verificare(form)
|
|
{
|
|
if(form.listtype.value == "") {
|
|
alert ("Please select one of the following actions: Blacklist or Whitelist");
|
|
form.button2.focus();
|
|
return false;
|
|
}
|
|
|
|
if(form.bulk.value == "") {
|
|
alert ("Please write a row for the IP entry");
|
|
form.bulk.focus();
|
|
return false;
|
|
}
|
|
|
|
}
|
|
-->
|
|
</script>
|
|
<script>
|
|
$(document).ready(function(){
|
|
var date_input=$('input[name="date"]'); //our date input has the name "date"
|
|
var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
|
|
var options={
|
|
format: 'yyyy-mm-dd',
|
|
container: container,
|
|
todayHighlight: true,
|
|
autoclose: true,
|
|
};
|
|
date_input.datepicker(options);
|
|
|
|
})
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
var date_input=$('input[name="date2"]'); //our date input has the name "date"
|
|
var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
|
|
var options={
|
|
format: 'yyyy-mm-dd',
|
|
container: container,
|
|
todayHighlight: true,
|
|
autoclose: true,
|
|
};
|
|
date_input.datepicker(options);
|
|
|
|
})
|
|
</script>
|
|
|
|
<?php
|
|
include('topmenu.php');
|
|
include('conn.php');
|
|
include('functions.php');
|
|
|
|
?>
|
|
<?php
|
|
/*IP
|
|
adddate
|
|
enddate
|
|
type
|
|
reason
|
|
*/
|
|
|
|
|
|
?>
|
|
<div style="padding-left:20px">
|
|
<h2>Add IP to Blacklist / Whitelist in Bulk</h2>
|
|
<form name="ip" action="add_ip_bulk_save.php" method="POST" class="form-horizontal" onSubmit="return verificare(this);">
|
|
<div class="form-group">
|
|
<div class="row line10">
|
|
<div class="col-sm-2"></div>
|
|
<!--<div class="col-sm-10">
|
|
<p style='font-style: italic; color: #0084B4;'>* Enter date in the following format:<br>
|
|
ip value,type,enddate,reason<br>
|
|
e.g.: <b>195.54.99.53/24,1,20221125065600,Manual Add by Didier</b></p>
|
|
</div>-->
|
|
</div>
|
|
<div class="row line10">
|
|
<div class="col-sm-2"></div>
|
|
<div class="form-check form-check-inline col-sm-8">
|
|
<label class="form-check-label" for="button2" style="margin-right:20px">
|
|
<input class="form-check-input" type="radio" name="listtype" id="button2" value="b">
|
|
Blacklist
|
|
</label>
|
|
<label class="form-check-label" for="button3">
|
|
<input class="form-check-input" type="radio" name="listtype" id="button3" value="w">
|
|
Whitelist
|
|
</label>
|
|
</div>
|
|
<div class="form-check form-check-inline col-sm-2"></div>
|
|
</div>
|
|
<div class="row line10">
|
|
<label class="col-sm-2 control-label">Block IP for: </label>
|
|
<div class="col-sm-2">
|
|
Years<input name="years" type="text" placeholder="Blocked for Years" class="form-control">
|
|
</div>
|
|
<div class="col-sm-2">
|
|
Months<input name="months" type="text" placeholder="Blocked for Months" class="form-control">
|
|
</div>
|
|
<div class="col-sm-2">
|
|
Days<input name="days" type="text" placeholder="Blocked for Days" class="form-control">
|
|
</div>
|
|
<div class="col-sm-2">
|
|
  <label for="chkb" class="form-control">Permanent -> <input id="chkb" name="perm" type="checkbox" checked> ?</label>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
<div class="row line10">
|
|
<label class="col-sm-2 control-label">Reason: </label>
|
|
<div class="col-sm-8"><input name="reason" type="text" placeholder="Enter Reason" class="form-control" ></div>
|
|
</div>
|
|
<br>
|
|
<div class="row line10">
|
|
<label class="col-sm-2 control-label">Type: </label>
|
|
<div class="col-sm-8">
|
|
<select class="form-control" name="type">
|
|
<?php
|
|
$sql_type="SELECT type,label FROM type WHERE status='1' ORDER BY type";
|
|
$sql_rez=mysqli_query($con,$sql_type);
|
|
|
|
while($row_type=mysqli_fetch_array($sql_rez)){
|
|
echo "<option value='".$row_type['type']."'>".$row_type['label']."</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
<br>
|
|
</div>
|
|
</div>
|
|
<div class="row line10">
|
|
<label class="col-sm-2 control-label">Multiple IPs </label>
|
|
|
|
<div class="col-sm-8"><textarea name="bulk" placeholder="Enter IPs one per line" class="form-control" rows="10"></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<br>
|
|
<div class="row line10">
|
|
<div class="col-sm-2"></div>
|
|
<div class="col-sm-8">
|
|
<input type="submit" value="Save" class="btn btn-primary">
|
|
<input type="button" value="Cancel" class="btn btn-warning" onclick='window.location.href="<?php echo"add_ip_frm.php?"; ?>"'>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php
|
|
include('footer.php');
|
|
?>
|