+
+
+
+
diff --git a/add_type_save.php b/add_type_save.php
new file mode 100644
index 0000000..9611c00
--- /dev/null
+++ b/add_type_save.php
@@ -0,0 +1,83 @@
+".mysqli_error($con);
+ $_SESSION['ret_link']="add_type_frm.php";
+ header("location:error.php?var=2");
+ return false;
+}
+
+if(mysqli_query($con,$sql_action)){
+ $_SESSION['rezult_msg']="Type successfully added/updated to the database.";
+ $link="add_type_frm.php";
+ echo $_SESSION['rezult_msg'];
+ header("location:$link?var=1");
+ return false;
+}
+else{
+ $_SESSION['rezult_msg']="The value was not added/updated to the database. Please try again.
".mysqli_error($con);
+ $_SESSION['ret_link']="add_type_frm.php";
+ header("location:error.php?var=2");
+ return false;
+}
+
+?>
\ No newline at end of file
diff --git a/blacklist.php b/blacklist.php
new file mode 100644
index 0000000..44ccdfa
--- /dev/null
+++ b/blacklist.php
@@ -0,0 +1,193 @@
+format('D, d M Y H:i:s T');
+
+ $lMod = "Last-Modified: " . $fStamp;
+ header($lMod);
+ if($_SERVER['REQUEST_METHOD']=='HEAD') {
+ $con->close();
+ echo("Something to make php quit and return head..");
+ }
+
+ $dPart = date("YmdHis");
+
+ if(!isset($_GET["a"]))
+ {
+ $action = "display";
+ }
+ if(isset($_GET["a"]))
+ {
+ $action = strtolower($_GET["a"]);
+ }
+
+ if ($action == "display") {
+
+ //echo "; Expires: Sun, 29 Sep 2019 05:01:00 GMT";
+ //echo "\r\n";
+
+ $SQL ="SELECT blacklist.ip, blacklist.adddate, blacklist.reason FROM blacklist WHERE blacklist.adddate < ".$dPart." AND blacklist.enddate > ".$dPart." ORDER BY blacklist.ip ASC";
+ $result = mysqli_query($con,$SQL);
+ $num_rows = mysqli_num_rows($result);
+
+ header("Content-Type: text/plain");
+
+ echo "; https://www.home.daprogs.net/api/ipban199/blacklist.php";
+ echo "\r\n";
+
+// echo "; DAProgs BlackList ".date("Y/m/d")." - (c) 2019 DAProgs.com";
+ echo "; DAProgs BlackList - (c) 2019 DAProgs.com";
+ echo "\r\n";
+
+ echo "; Last-Modified: ".$fStamp;
+// echo "; Last-Modified: ".substr($UpdateDate,0,4)."/".substr($UpdateDate,4,2)."/".substr($UpdateDate,6,2)." ".substr($UpdateDate,8,2).":".substr($UpdateDate,10,2).":".substr($UpdateDate,12,2)." EST.";
+ echo "\r\n";
+
+ echo "; Blacklist contains ".$num_rows." elements.";
+ echo "\r\n";
+
+ while($row = mysqli_fetch_array($result))
+ {
+ echo $row['ip']." ; ".$row['reason']." - ".substr($row['adddate'],0,4)."/".substr($row['adddate'],4,2)."/".substr($row['adddate'],6,2)."";
+ echo "\r\n";
+ //echo $row['ip'];
+ //echo "\r\n";
+ }
+ mysqli_close($con);
+
+ //echo "";
+ //echo "\r\n";
+ }
+ elseif ($action == "add") {
+ if(!isset($_GET["ip"]))
+ {
+ die("Missing parameters 1.");
+ }
+ $ip = strtolower($_GET["ip"]);
+
+ if(!isset($_GET["type"]))
+ {
+ die("Missing parameters 2.");
+ }
+ $type = $_GET["type"];
+
+ if(!isset($_GET["date"]))
+ {
+ die("Missing parameters 3.");
+ }
+ $enddate = $_GET["date"];
+
+ if(!isset($_GET["reason"]))
+ {
+ die("Missing parameters 4.");
+ }
+ $reason = urldecode($_GET["reason"]);
+
+ $SQL ="INSERT INTO blacklist (ip, type, adddate, enddate, reason) VALUES ('".$ip."', ".$type.", ".$dPart.", ".$enddate.", '".$reason."')";
+
+ if ($con->query($SQL) === TRUE) {
+ $SQL = "UPDATE info SET last=".$dPart." WHERE list=0;";
+ $con->query($SQL);
+ echo "SUCCESS";
+ } else {
+ $SQL = "UPDATE blacklist SET enddate=".$enddate.", type=".$type.", reason='".$reason."' WHERE ip='".$ip."';";
+ if ($con->query($SQL) === TRUE) {
+ $SQL = "UPDATE info SET last=".$dPart." WHERE list=0;";
+ $con->query($SQL);
+ echo "SUCCESS UPDATE";
+ } else {
+ echo "Error: " . $SQL . "
" . $con->error;
+ }
+ }
+
+
+ $con->close();
+ }
+ elseif ($action == "log") {
+
+ //'50.238.150.110 [1C28] 09:12:06 Authentication [IMAP] - Result=1 User=miniservice@theautomaster.com Method=4
+ //'0 1 2 3 4 5 6 7 8
+
+ // time
+ // ip
+ // type
+ // sf
+ // account
+
+ if(!isset($_GET["ip"]))
+ {
+ die("Missing parameters 1.");
+ }
+ $ip = strtolower($_GET["ip"]);
+
+ if(!isset($_GET["date"]))
+ {
+ die("Missing parameters 2.");
+ }
+ $datetime = $_GET["date"];
+
+ if(!isset($_GET["sf"]))
+ {
+ die("Missing parameters 3.");
+ }
+ $sf = $_GET["sf"];
+
+ if(!isset($_GET["type"]))
+ {
+ die("Missing parameters 4.");
+ }
+ $logtype = $_GET["type"];
+
+ if(!isset($_GET["account"]))
+ {
+ die("Missing parameters 5.");
+ }
+ $account = urldecode($_GET["account"]);
+
+ $SQL ="INSERT INTO iplog (time, ip, type, sf, account) VALUES ('".$datetime."', '".$ip."', '".$logtype."', ".$sf.", '".$account."')";
+
+ if ($con->query($SQL) === TRUE) {
+ echo "SUCCESS";
+ } else {
+ echo "Error: " . $SQL . "
" . $con->error;
+ }
+ $con->close();
+ }
+ elseif ($action == "rem") {
+ if(!isset($_GET["ip"]))
+ {
+ die("Missing parameters 1.");
+ }
+ $ip = strtolower($_GET["ip"]);
+
+ $SQL ="DELETE FROM blacklist WHERE blacklist.ip = '".$ip."';";
+
+ if ($con->query($SQL) === TRUE) {
+ $SQL = "UPDATE info SET last=".$dPart." WHERE list=0;";
+ $con->query($SQL);
+ echo "SUCCESS";
+ } else {
+ echo "Error: " . $SQL . "
" . $con->error;
+ }
+ $con->close();
+ }
+?>
+
diff --git a/delete.php b/delete.php
new file mode 100644
index 0000000..d742651
--- /dev/null
+++ b/delete.php
@@ -0,0 +1,58 @@
+"" && $ip<>""){
+ $sql_del="DELETE FROM $table_name WHERE ip='$ip'";
+ $sql_last_upd="UPDATE info SET last=$now WHERE list='$list'";
+
+ if(mysqli_query($con,$sql_del)){
+ $_SESSION['rezult_msg']="IP successfully deleted in the database.";
+ $rez_last_upd=mysqli_query($con,$sql_last_upd);
+ echo $_SESSION['rezult_msg'];
+ $link="index.php?var=1";
+ header("location:$link");
+ return false;
+ }
+ else{
+ $_SESSION['rezult_msg']="The value was not deleted from the database. Please try again.
".mysqli_error($con);
+ $_SESSION['ret_link']="index.php";
+ header("location:error.php?var=2");
+ return false;
+ }
+}
+else{
+ $_SESSION['rezult_msg']="There are not enough parameters to erase the value from the database.";
+ $_SESSION['ret_link']="index.php";
+ header("location:error.php?var=2");
+ return false;
+}
+?>
\ No newline at end of file
diff --git a/edit_ip_frm.php b/edit_ip_frm.php
new file mode 100644
index 0000000..ae30766
--- /dev/null
+++ b/edit_ip_frm.php
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
Edit IP Info in -
+
+
diff --git a/edit_ip_save.php b/edit_ip_save.php
new file mode 100644
index 0000000..e1f8546
--- /dev/null
+++ b/edit_ip_save.php
@@ -0,0 +1,96 @@
+".mysqli_error($con);
+ $_SESSION['ret_link']="search_db.php?";
+ header("location:error.php?var=2");
+ return false;
+ }
+
+?>
\ No newline at end of file
diff --git a/error.php b/error.php
new file mode 100644
index 0000000..2b607ab
--- /dev/null
+++ b/error.php
@@ -0,0 +1,11 @@
+
+
+
Error
+
Return
+
+
\ No newline at end of file
diff --git a/export.php b/export.php
new file mode 100644
index 0000000..79f20d8
--- /dev/null
+++ b/export.php
@@ -0,0 +1,38 @@
+
\ No newline at end of file
diff --git a/footer.php b/footer.php
new file mode 100644
index 0000000..d733a1f
--- /dev/null
+++ b/footer.php
@@ -0,0 +1,2 @@
+