andre 4 rokov pred
rodič
commit
e17b1ed233
1 zmenil súbory, kde vykonal 25 pridanie a 1 odobranie
  1. 25 1
      action.php

+ 25 - 1
action.php

@@ -5,6 +5,30 @@ class action {
         $this->db = new db();
     }
 
+    public function getWhiteList() {
+        $list = array();
+        $dbAction = $this->db->prepare("SELECT ip FROM whitelist ORDER BY ip ASC");
+        $dbAction->execute();
+        $dbAction->store_result();
+        $dbAction->bind_result($ip);
+        while($dbAction->fetch()) {
+            array_push($list,$ip);
+        };
+        return $list;
+    }
+
+    public function getBlackList() {
+        $list = array();
+        $dbAction = $this->db->prepare("SELECT ip FROM blacklist ORDER BY ip ASC");
+        $dbAction->execute();
+        $dbAction->store_result();
+        $dbAction->bind_result($ip);
+        while($dbAction->fetch()) {
+            array_push($list,$ip);
+        };
+        return $list;
+    }
+
     public function getList() {
         $list = array();
         $dbAction = $this->db->prepare("SELECT ip FROM list UNION SELECT ip FROM blacklist ORDER BY ip ASC");
@@ -12,7 +36,7 @@ class action {
         $dbAction->store_result();
         $dbAction->bind_result($ip);
         while($dbAction->fetch()) {
-            array_push($list,long2ip($ip));
+            array_push($list,$ip);
         };
         return $list;
     }