|
/**
* ip限制访问
* @param $ip 要检查的ip地址
* @param - $accesslist 允许访问的ip地址
* @param 返回结果
*/
function ipbanned($onlineip) {
global $_G;
if($_G['setting']['ipaccess'] && !ipaccess($onlineip, $_G['setting']['ipaccess'])) {
return TRUE;
}
loadcache('ipbanned');
if(empty($_G['cache']['ipbanned'])) {
return FALSE;
} else {
if($_G['cache']['ipbanned']['expiration'] < TIMESTAMP) {
require_once libfile('function/cache');
updatecache('ipbanned');
}
return preg_match("/^(".$_G['cache']['ipbanned']['regexp'].")$/", $onlineip);
}
}
|
|