• [织梦吧]唯一域名:www.dedecms8.com,织梦DedeCMS学习平台.

当前位置: > CMS教程 > discuz教程 >

Discuz! 关于注册的邀请码分析

来源: www.dedecms8.com 编辑:织梦吧 时间:2012-02-07点击:
 

开启邀请注册
进入站点后台->全局->注册与访问,找到允许新用户注册,勾选开放邀请注册方式。

代码分析
找到source\class\class_member.php文件,在336行附近
 

  1. $invitestatus = false;  
  2.                 if($this->setting['regstatus'] == 2) {  
  3.                         if($this->setting['inviteconfig']['inviteareawhite']) {  
  4.                                 $location = $whitearea = '';  
  5.                                 $location = trim(convertip($_G['clientip'], "./"));  
  6.                                 if($location) {  
  7.                                         $whitearea = preg_quote(trim($this->setting['inviteconfig']['inviteareawhite']), '/');  
  8.                                         $whitearea = str_replace(array("\\*"), array('.*'), $whitearea);  
  9.                                         $whitearea = '.*'.$whitearea.'.*';  
  10.                                         $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i';  
  11.                                         if(@preg_match($whitearea, $location)) {  
  12.                                                 $invitestatus = true;  
  13.                                         }  
  14.                                 }  
  15.                         }  
  16.  
  17.                         if($this->setting['inviteconfig']['inviteipwhite']) {  
  18.                                 foreach(explode("\n", $this->setting['inviteconfig']['inviteipwhite']) as $ctrlip) {  
  19.                                         if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {  
  20.                                                 $invitestatus = true;  
  21.                                                 break;  
  22.                                         }  
  23.                                 }  
  24.                         }  
  25.                 } 

About D8

  • ©2014 织梦吧(d8) DedeCMS学习交流平台
  • 唯一网址 www.DedeCMS8.com 网站地图
  • 联系我们 1978130638@qq.com ,  QQ