ソースを参照

add admin view

andre 4 年 前
コミット
28e736001a
2 ファイル変更13 行追加1 行削除
  1. 12 0
      action.php
  2. 1 1
      list.php

+ 12 - 0
action.php

@@ -54,6 +54,18 @@ class action {
     }
 
     public function getList() {
+        $list = array();
+        $dbAction = $this->db->prepare("SELECT ip FROM list ORDER BY ip ASC");
+        $dbAction->execute();
+        $dbAction->store_result();
+        $dbAction->bind_result($ip);
+        while($dbAction->fetch()) {
+            array_push($list,$ip);
+        };
+        return $list;
+    }
+
+    public function getBlockList() {
         $list = array();
         $dbAction = $this->db->prepare("SELECT ip FROM list UNION SELECT ip FROM blacklist ORDER BY ip ASC");
         $dbAction->execute();

+ 1 - 1
list.php

@@ -11,7 +11,7 @@ if (!(new token)->isUser($token)) {
     echo "user access denied";
     exit;
 }
-$list = (new action)->getList();
+$list = (new action)->getBlockList();
 foreach($list as $ip) {
     echo long2ip($ip) . PHP_EOL;
 }