Example #1
0
 /**
  * Ban comment ip
  */
 function banIpAction()
 {
     $bannedIp = new BannedIpRecord();
     $bannedIp->remoteIp = $this->request->remoteIp;
     $bannedIp->save();
     $this->set("status", "OK");
     $this->viewClass = "JsonView";
 }
Example #2
0
 function saveNewIpBanAction()
 {
     $bannedIps = preg_split("#\r?\n#", $this->request->bannedIps);
     foreach ($bannedIps as $ip) {
         $ip = trim($ip);
         if (empty($ip)) {
             continue;
         }
         $bannedIp = new BannedIpRecord();
         $bannedIp->remoteIp = $ip;
         $bannedIp->save();
     }
     $this->redirect($this->moduleLink("banIp"));
 }