예제 #1
0
 public function unblockIp()
 {
     foreach (array_keys($this->params()->ip_ban) as $ban_id) {
         IpBans::destroyAll("id = ?", $ban_id);
     }
     $this->redirectTo("user#show_blocked_users");
 }
예제 #2
0
 protected function check_ip_ban()
 {
     if ($this->request()->controller() == "banned" and $this->request()->action() == "index") {
         return;
     }
     $ban = $this->get_ip_ban();
     if (!$ban) {
         return;
     }
     if ($ban->expires_at && $ban->expires_at < date('Y-m-d H:i:s')) {
         IpBans::destroyAll("ip_addr = '{$this->request()->remoteIp()}'");
         return;
     }
     $this->redirectTo('banned#index');
 }