|
|
@@ -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;
|
|
|
}
|