<?php

if (!defined('XOOPS_ROOT_PATH')) exit();

class IPbanning_Filter extends XCube_ActionFilter
{
	function preBlockFilter()
	{
		if ($this->mController->mConfig['enable_badips']) {
			if(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR']) {
				foreach ($this->mController->mConfig['bad_ips'] as $bi) {
					if(strstr($_SERVER['REMOTE_ADDR'],$bi)!==false)
						die();
				}
			}
		}
	}
}

?>