无限星辰工作室-客户无限互联网动力之源

标题: Discuz!x3.4 添加禁止注册地区 [打印本页]

作者: crx349    时间: 2018-10-25 18:04
标题: Discuz!x3.4 添加禁止注册地区
打开:
/source/class/class_member.php
搜索
  1. if($_G['cache']['ipctrl']['ipregctrl']) {
  2.                                 foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
  3.                                         if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
  4.                                                 $ctrlip = $ctrlip.'%';
  5.                                                 $this->setting['regctrl'] = $this->setting['ipregctrltime'];
  6.                                                 break;
  7.                                         } else {
  8.                                                 $ctrlip = $_G['clientip'];
  9.                                         }
  10.                                 }
  11.                         } else {
  12.                                
复制代码
改为
  1. if($_G['cache']['ipctrl']['ipregctrl']) {
  2.                                 require_once libfile('function/misc');
  3.                 $ipLoc=convertip($_G['clientip']);
  4.                                 foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
  5.                                         if(strstr($ipLoc,$ctrlip)){
  6.                         $this->setting['regctrl'] = $this->setting['ipregctrltime'];
  7.                         file_put_contents('data/logs/register_ban.log',date("Y-m-d H:i:s")."\t{$_G['clientip']}\t{$ipLoc}\n",FILE_APPEND);
  8.                         showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl']));
  9.                         exit;
  10.                     }
  11.                                         if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
  12.                                                 $ctrlip = $ctrlip.'%';
  13.                                                 $this->setting['regctrl'] = $this->setting['ipregctrltime'];
  14.                                                 break;
  15.                                         } else {
  16.                                                 $ctrlip = $_G['clientip'];
  17.                                         }
  18.                                 }
  19.                         } else {
  20.                                 $ctrlip = $_G['clientip'];
  21.                         }
复制代码





欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://www.xmspace.net/) Powered by Discuz! X3.4