示例#1
0
文件: BlockIps.php 项目: ksst/kf
 public function execute(\Koch\Event\Event $event)
 {
     $ip = \Koch\Http\HttpRequest::getRemoteAddress();
     if (in_array($ip, $this->blockedIps, true)) {
         $event->cancel();
     }
 }
示例#2
0
 public function execute(\Koch\Event\Event $event)
 {
     $authdata = $event->getInfo();
     $logdata = [date(), $this->request->getRemoteAddress(), $event->getName(), $authdata['username']];
     $this->logger->log($logdata);
 }