예제 #1
0
파일: Bannedips.php 프로젝트: hoalangoc/ftf
 public function removeAddressRange($startAddress, $stopAddress)
 {
     $startAddressObject = new Engine_IP($startAddress);
     $stopAddressObject = new Engine_IP($stopAddress);
     if (!$startAddressObject->isValid()) {
         throw new Engine_Exception('Invalid start IP address');
     }
     if (!$stopAddressObject->isValid()) {
         throw new Engine_Exception('Invalid stop IP address');
     }
     $startAddressBinary = $startAddressObject->toBinary();
     $stopAddressBinary = $stopAddressObject->toBinary();
     // Delete
     $this->delete(array('start' => $startAddressBinary, 'stop' => $stopAddressBinary));
     $removedIds = $this->select()->from($this, 'bannedip_id')->where(delete(array('start' => $startAddressBinary, 'stop' => $stopAddressBinary)))->query()->fetchAll(Zend_Db::FETCH_COLUMN);
     if (count($removedIds) != 0) {
         $extraTable = Engine_Api::_()->getDBTable('extrainfo', 'ynbanmem');
         $extraTable->delete(array('banned_id IN(?)' => $removedIds, 'banned_type = 1'));
     }
     return $this;
 }
예제 #2
0
 public function removeAddressRange($startAddress, $stopAddress)
 {
     $startAddressObject = new Engine_IP($startAddress);
     $stopAddressObject = new Engine_IP($stopAddress);
     if (!$startAddressObject->isValid()) {
         throw new Engine_Exception('Invalid start IP address');
     }
     if (!$stopAddressObject->isValid()) {
         throw new Engine_Exception('Invalid stop IP address');
     }
     $startAddressBinary = $startAddressObject->toBinary();
     $stopAddressBinary = $stopAddressObject->toBinary();
     // Delete
     $this->delete(array('start' => $startAddressBinary, 'stop' => $stopAddressBinary));
     return $this;
 }