无限星辰工作室-客户无限互联网动力之源
标题:
Discuz!x3.4 添加禁止注册地区
[打印本页]
作者:
crx349
时间:
2018-10-25 18:04
标题:
Discuz!x3.4 添加禁止注册地区
打开:
/source/class/class_member.php
搜索
if($_G['cache']['ipctrl']['ipregctrl']) {
foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
$ctrlip = $ctrlip.'%';
$this->setting['regctrl'] = $this->setting['ipregctrltime'];
break;
} else {
$ctrlip = $_G['clientip'];
}
}
} else {
复制代码
改为
if($_G['cache']['ipctrl']['ipregctrl']) {
require_once libfile('function/misc');
$ipLoc=convertip($_G['clientip']);
foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
if(strstr($ipLoc,$ctrlip)){
$this->setting['regctrl'] = $this->setting['ipregctrltime'];
file_put_contents('data/logs/register_ban.log',date("Y-m-d H:i:s")."\t{$_G['clientip']}\t{$ipLoc}\n",FILE_APPEND);
showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl']));
exit;
}
if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
$ctrlip = $ctrlip.'%';
$this->setting['regctrl'] = $this->setting['ipregctrltime'];
break;
} else {
$ctrlip = $_G['clientip'];
}
}
} else {
$ctrlip = $_G['clientip'];
}
复制代码
欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/)
Powered by Discuz! X3.4