开启邀请码注册:
进入站点后台->全局->注册与访问,找到允许新用户注册,勾选开放邀请注册方式。
代码分析:
找到source\class\class_member.php文件,在336行附近
- $invitestatus = false;
- if($this->setting['regstatus'] == 2) {
- if($this->setting['inviteconfig']['inviteareawhite']) {
- $location = $whitearea = '';
- $location = trim(convertip($_G['clientip'], "./"));
- if($location) {
- $whitearea = preg_quote(trim($this->setting['inviteconfig']['inviteareawhite']), '/');
- $whitearea = str_replace(array("\\*"), array('.*'), $whitearea);
- $whitearea = '.*'.$whitearea.'.*';
- $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i';
- if(@preg_match($whitearea, $location)) {
- $invitestatus = true;
- }
- }
- }
- if($this->setting['inviteconfig']['inviteipwhite']) {
- foreach(explode("\n", $this->setting['inviteconfig']['inviteipwhite']) as $ctrlip) {
- if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
- $invitestatus = true;
- break;
- }
- }
- }
- }