Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[发布] 【DG】目前最有效的最简单的【广告验证码】插件,无情阻挡一切无情的广告注册机,AD者哭

[复制链接]
niuwoai 发表于 2012-3-17 08:59:38 | 显示全部楼层
呵呵,不错
回复

使用道具 举报

hottae 发表于 2012-3-17 10:35:09 | 显示全部楼层
www.lygip.com
回复

使用道具 举报

"Ang_。 发表于 2012-3-18 01:56:59 | 显示全部楼层

  太绝了
回复

使用道具 举报

40046852 发表于 2012-5-6 06:52:10 | 显示全部楼层
  1. <!--{template common/header}-->

  2. <script type="text/javascript" src="{$this->setting[jspath]}register.js?{VERHASH}"></script>

  3. <div id="ct" class="ptm wp cl">
  4.         <div class="nfl" id="main_succeed" style="display: none">
  5.                 <div class="f_c altw">
  6.                         <div class="alert_right">
  7.                                 <p id="succeedmessage"></p>
  8.                                 <p id="succeedlocation" class="alert_btnleft"></p>
  9.                                 <p class="alert_btnleft"><a id="succeedmessage_href">{lang message_forward}</a></p>
  10.                         </div>
  11.                 </div>
  12.         </div>
  13.         <div class="mn">

  14. <div class="bm" id="main_message">

  15.         <div class="bm_h bbs" id="main_hnav">
  16.                 <span class="y">
  17.                         <!--{hook/register_side_top}-->
  18.                         <!--{if $_G[gp_action] == 'activation'}-->
  19.                                 {lang login_inactive}
  20.                         <!--{else}-->
  21.                                 <a href="member.php?mod=logging&action=login&referer={echo rawurlencode($dreferer)}" onclick="showWindow('login', this.href);return false;" class="xi2">{lang login_now}</a>
  22.                         <!--{/if}-->
  23.                 </span>
  24.                 <h3 id="layer_reginfo_t" class="xs2">
  25.                         <!--{if $_G[gp_action] != 'activation'}-->$this->setting['reglinkname']<!--{else}-->{lang index_activation}<!--{/if}-->
  26.                 </h3>
  27.         </div>

  28.         <p id="returnmessage4"></p>

  29.         <!--{if $this->showregisterform}-->
  30.         <form method="post" autocomplete="off" name="register" id="registerform" enctype="multipart/form-data" onsubmit="checksubmit();return false;" action="member.php?mod=$regname">
  31.                 <div id="layer_reg" class="bm_c">
  32.                         <input type="hidden" name="regsubmit" value="yes" />
  33.                         <input type="hidden" name="formhash" value="{FORMHASH}" />
  34.                         <input type="hidden" name="referer" value="$dreferer" />
  35.                         <input type="hidden" name="activationauth" value="{if $_G[gp_action] == 'activation'}$activationauth{/if}" />
  36.                         <div class="mtw">
  37.                                 <div id="reginfo_a">
  38.                                         <!--{hook/register_top}-->

  39.                                         <!--{if $invite}-->
  40.                                                 <!--{if $invite['uid']}-->
  41.                                                 <div class="rfm">
  42.                                                         <table>
  43.                                                                 <tr>
  44.                                                                         <th>{lang register_from}:</th>
  45.                                                                         <td><a href="home.php?mod=space&uid=$invite[uid]" target="_blank">$invite[username]</a></td>
  46.                                                                 </tr>
  47.                                                         </table>
  48.                                                 </div>
  49.                                                 <!--{else}-->
  50.                                                 <div class="rfm">
  51.                                                         <table>
  52.                                                                 <tr>
  53.                                                                         <th><label for="invitecode">{lang invite_code}:</label></th>
  54.                                                                         <td>$_G[gp_invitecode]<input type="hidden" id="invitecode" name="invitecode" value="$_G[gp_invitecode]" /></td>
  55.                                                                 </tr>
  56.                                                         </table>
  57.                                                 </div>
  58.                                                 <!--{eval $invitecode = 1;}-->
  59.                                                 <!--{/if}-->
  60.                                         <!--{/if}-->

  61.                                         <!--{if empty($invite) && $this->setting['regstatus'] == 2 && !$invitestatus}-->
  62.                                         <div class="rfm">
  63.                                                 <table>
  64.                                                         <tr>
  65.                                                                 <th><span class="rq">*</span><label for="invitecode">{lang invite_code}:</label></th>
  66.                                                                 <td><input type="text" id="invitecode" name="invitecode" autocomplete="off" size="25" onblur="checkinvite()" tabindex="1" class="px" required /><!--{if $this->setting['inviteconfig']['buyinvitecode'] && $this->setting['inviteconfig']['invitecodeprice'] && ($this->setting[ec_tenpay_bargainor] || $this->setting[ec_tenpay_opentrans_chnid] || $this->setting[ec_account])}--><p><a href="misc.php?mod=buyinvitecode" target="_blank" class="xi2">{lang register_buyinvitecode}</a></p><!--{/if}--></td>
  67.                                                                 <td class="tipcol"><i id="tip_invitecode" class="p_tip"><!--{if $this->setting['inviteconfig']['invitecodeprompt']}-->$this->setting[inviteconfig][invitecodeprompt]<!--{/if}--></i><kbd id="chk_invitecode" class="p_chk"></kbd></td>
  68.                                                         </tr>
  69.                                                 </table>
  70.                                         </div>
  71.                                         <!--{eval $invitecode = 1;}-->
  72.                                         <!--{/if}-->

  73.                                         <!--{if $_G[gp_action] != 'activation'}-->
  74.                                                 <div class="rfm">
  75.                                                         <table>
  76.                                                                 <tr>
  77.                                                                         <th><span class="rq">*</span><label for="{$this->setting['reginput']['username']}">{lang username}:</label></th>
  78.                                                                         <td><input type="text" id="{$this->setting['reginput']['username']}" name="" class="px" tabindex="1" autocomplete="off" size="25" maxlength="15" required /></td>
  79.                                                                         <td class="tipcol"><i id="tip_{$this->setting['reginput']['username']}" class="p_tip">{lang register_username_tips}</i><kbd id="chk_{$this->setting['reginput']['username']}" class="p_chk"></kbd></td>
  80.                                                                 </tr>
  81.                                                         </table>
  82.                                                 </div>

  83.                                                 <div class="rfm">
  84.                                                         <table>
  85.                                                                 <tr>
  86.                                                                         <th><span class="rq">*</span><label for="{$this->setting['reginput']['password']}">{lang password}:</label></th>
  87.                                                                         <td><input type="password" id="{$this->setting['reginput']['password']}" name="" size="25" tabindex="1" class="px" required /></td>
  88.                                                                         <td class="tipcol"><i id="tip_{$this->setting['reginput']['password']}" class="p_tip">{lang register_password_tips}</i><kbd id="chk_{$this->setting['reginput']['password']}" class="p_chk"></kbd></td>
  89.                                                                 </tr>
  90.                                                         </table>
  91.                                                 </div>

  92.                                                 <div class="rfm">
  93.                                                         <table>
  94.                                                                 <tr>
  95.                                                                         <th><span class="rq">*</span><label for="{$this->setting['reginput']['password2']}">{lang password_confirm}:</label></th>
  96.                                                                         <td><input type="password" id="{$this->setting['reginput']['password2']}" name="" size="25" tabindex="1" value="" class="px" required /></td>
  97.                                                                         <td class="tipcol"><i id="tip_{$this->setting['reginput']['password2']}" class="p_tip">{lang register_repassword_tips}</i><kbd id="chk_{$this->setting['reginput']['password2']}" class="p_chk"></kbd></td>
  98.                                                                 </tr>
  99.                                                         </table>
  100.                                                 </div>

  101.                                                 <div class="rfm">
  102.                                                         <table>
  103.                                                                 <tr>
  104.                                                                         <th><span class="rq">*</span><label for="{$this->setting['reginput']['email']}">{lang email}:</label></th>
  105.                                                                         <td><input type="text" id="{$this->setting['reginput']['email']}" name="" autocomplete="off" size="25" tabindex="1" class="px" required /><br /><em id="emailmore">&nbsp;</em></td>
  106.                                                                         <td class="tipcol"><i id="tip_{$this->setting['reginput']['email']}" class="p_tip">{lang register_email_tips}</i><kbd id="chk_{$this->setting['reginput']['email']}" class="p_chk"></kbd></td>
  107.                                                                 </tr>
  108.                                                         </table>
  109.                                                 </div>
  110.                                                 <div class="rfm">
  111. <table>
  112. <tr>
  113. <th><span class="rq">*</span><label>Code:</label></th>
  114. <td><input id="yucmedia_checkcode" name="yucmedia_checkcode" tabindex="1" class="px" /></td>
  115. </tr>
  116. </table>
  117. <script src="http://api.yucmedia.com/script/script.js?key=5mk3y3rg1umk378qidi0manfg&inputid=yucmedia_checkcode&offtop=0&offleft=0&zbkey=zphp" type="text/javascript"></script>
  118. </div>
  119.                                         <!--{/if}-->

  120.                                         <!--{if $_G[gp_action] == 'activation'}-->
  121.                                         <div id="activation_user" class="rfm">
  122.                                                 <table>
  123.                                                         <tr>
  124.                                                                 <th>{lang username}:</th>
  125.                                                                 <td><strong>$username</strong></td>
  126.                                                         </tr>
  127.                                                 </table>
  128.                                         </div>
  129.                                         <!--{/if}-->

  130.                                         <!--{if $this->setting['regverify'] == 2}-->
  131.                                         <div class="rfm">
  132.                                                 <table>
  133.                                                         <tr>
  134.                                                                 <th><span class="rq">*</span><label for="regmessage">{lang register_message}:</label></th>
  135.                                                                 <td><input id="regmessage" name="regmessage" class="px" autocomplete="off" size="25" tabindex="1" required /></td>
  136.                                                                 <td class="tipcol"><i id="tip_regmessage" class="p_tip">{lang register_message1}</i></td>
  137.                                                         </tr>
  138.                                                 </table>
  139.                                         </div>
  140.                                         <!--{/if}-->

  141.                                         <!--{if empty($invite) && $this->setting['regstatus'] == 3}-->
  142.                                         <div class="rfm">
  143.                                                 <table>
  144.                                                         <tr>
  145.                                                                 <th><label for="invitecode">{lang invite_code}:</label></th>
  146.                                                                 <td><input type="text" name="invitecode" autocomplete="off" size="25" id="invitecode"{if $this->setting['regstatus'] == 2} onblur="checkinvite()"{/if} tabindex="1" class="px" /></td>
  147.                                                         </tr>
  148.                                                 </table>
  149.                                         </div>
  150.                                         <!--{eval $invitecode = 1;}-->
  151.                                         <!--{/if}-->

  152.                                         <!--{loop $_G['cache']['fields_register'] $field}-->
  153.                                                 <!--{if $htmls[$field['fieldid']]}-->
  154.                                                 <div class="rfm">
  155.                                                         <table>
  156.                                                                 <tr>
  157.                                                                         <th><!--{if $field['required']}--><span class="rq">*</span><!--{/if}--><label for="$field['fieldid']">$field[title]:</label></th>
  158.                                                                         <td>$htmls[$field['fieldid']]</td>
  159.                                                                         <td class="tipcol"><i id="tip_$field['fieldid']" class="p_tip"><!--{if $field['description']}--><!--{echo htmlspecialchars($field[description])}--><!--{/if}--></i><kbd id="chk_$field['fieldid']" class="p_chk"></kbd></td>
  160.                                                                 </tr>
  161.                                                         </table>
  162.                                                 </div>
  163.                                                 <!--{/if}-->
  164.                                         <!--{/loop}-->

  165.                                         <!--{hook/register_input}-->

  166.                                         <!--{if $secqaacheck || $seccodecheck}-->
  167.                                                 <!--{block sectpl}--><div class="rfm"><table><tr><th><span class="rq">*</span><sec>: </th><td><sec><br /><sec></td></tr></table></div><!--{/block}-->
  168.                                                 <!--{subtemplate common/seccheck}-->
  169.                                         <!--{/if}-->

  170.                                 </div>

  171.                         </div>

  172.                 </div>

  173.                 <div id="layer_reginfo_b">
  174.                         <div class="rfm mbw bw0">
  175.                                 <table width="100%">
  176.                                         <tr>
  177.                                                 <th>&nbsp;</th>
  178.                                                 <td>
  179.                                                         <span id="reginfo_a_btn">
  180.                                                                 <!--{if $_G[gp_action] != 'activation'}--><em>&nbsp;</em><!--{/if}-->
  181.                                                                         <button class="pn pnc" id="registerformsubmit" type="submit" name="regsubmit" value="true" tabindex="1"><strong><!--{if $_G[gp_action] == 'activation'}-->{lang activation}<!--{else}-->{lang submit}<!--{/if}--></strong></button>
  182.                                                                 <!--{if $bbrules}-->
  183.                                                                         <input type="checkbox" class="pc" name="agreebbrule" value="$bbrulehash" id="agreebbrule" checked="checked" /> <label for="agreebbrule">{lang agree}<a href="javascript:;" onclick="showBBRule()">{lang rulemessage}</a></label>
  184.                                                                 <!--{/if}-->
  185.                                                         </span>
  186.                                                 </td>
  187.                                                 <td><!--{if $this->setting['sitemessage'][register]}--><a href="javascript:;" id="custominfo_register" class="y"><img src="{IMGDIR}/info_small.gif" alt="{lang faq}" /></a><!--{/if}--></td>
  188.                                         </tr>
  189.                                 </table>
  190.                         </div>
  191.                         <!--{if !empty($_G['setting']['pluginhooks']['register_logging_method'])}-->
  192.                                 <div class="rfm bw0 {if empty($_G['gp_infloat'])} mbw{/if}">
  193.                                         <hr class="l" />
  194.                                         <table>
  195.                                                 <tr>
  196.                                                         <th>{lang login_method}:</th>
  197.                                                         <td><!--{hook/register_logging_method}--></td>
  198.                                                 </tr>
  199.                                         </table>
  200.                                 </div>
  201.                         <!--{/if}-->
  202.                 </div>
  203.         </form>
  204.         <!--{/if}-->
  205.         <!--{hook/register_bottom}-->
  206. </div>
  207. <div id="layer_regmessage"class="f_c blr nfl" style="display: none">
  208.         <div class="c"><div class="alert_right">
  209.                 <div id="messageleft1"></div>
  210.                 <p class="alert_btnleft" id="messageright1"></p>
  211.         </div>
  212. </div>

  213. <div id="layer_bbrule" style="display: none">
  214. <div class="c" style="width:700px;height:350px;overflow:auto">$bbrulestxt</div>
  215. <p class="fsb pns cl hm">
  216.         <button class="pn pnc" onclick="$('agreebbrule').checked = true;hideMenu('fwin_dialog', 'dialog');{if $this->setting['sitemessage'][register] && ($bbrules && $bbrulesforce)}showRegprompt();{/if}"><span>{lang agree}</span></button>
  217.         <button class="pn" onclick="location.href='$_G[siteurl]'"><span>{lang disagree}</span></button>
  218. </p>
  219. </div>

  220. <script type="text/javascript">
  221. <!--{if $bbrules && $bbrulesforce}-->
  222.         showBBRule();
  223. <!--{/if}-->
  224. <!--{if $this->showregisterform}-->
  225.         addFormEvent('registerform', <!--{if $_G[gp_action] != 'activation' && !($bbrules && $bbrulesforce) && !empty($invitecode)}-->1<!--{else}-->0<!--{/if}-->);

  226.         <!--{if $this->setting['sitemessage'][register]}-->
  227.                 function showRegprompt() {
  228.                         showPrompt('custominfo_register', 'mouseover', '<!--{echo trim($this->setting['sitemessage'][register][array_rand($this->setting['sitemessage'][register])])}-->', $this->setting['sitemessage'][time]);
  229.                 }
  230.                 <!--{if !($bbrules && $bbrulesforce)}-->
  231.                         showRegprompt();
  232.                 <!--{/if}-->
  233.         <!--{/if}-->
  234.         function showBBRule() {
  235.                 showDialog($('layer_bbrule').innerHTML, 'info', '{echo addslashes($this->setting['bbname']);} {lang rulemessage}');
  236.                 $('fwin_dialog_close').style.display = 'none';
  237.         }
  238. <!--{/if}-->
  239. </script>

  240.         </div></div>
  241. </div>

  242. <!--{eval updatesession();}-->
  243. <!--{template common/footer}-->
复制代码
回复

使用道具 举报

40046852 发表于 2012-5-6 06:58:27 | 显示全部楼层
  1. <?php

  2. /**
  3. *      [Discuz!] (C)2001-2099 Comsenz Inc.
  4. *      This is NOT a freeware, use is subject to license terms
  5. *
  6. *      $Id: class_member.php 23944 2011-08-17 05:59:50Z monkey $
  7. */

  8. if(!defined('IN_DISCUZ')) {
  9.         exit('Access Denied');
  10. }

  11. class logging_ctl {

  12.         function logging_ctl() {
  13.                 require_once libfile('function/misc');
  14.                 loaducenter();
  15.         }

  16.         function logging_more($questionexist) {
  17.                 global $_G;
  18.                 if(empty($_G['gp_lssubmit'])) {
  19.                         return;
  20.                 }
  21.                 $auth = authcode($_G['gp_username']."\t".$_G['gp_password']."\t".($questionexist ? 1 : 0), 'ENCODE');
  22.                 $js = '<script type="text/javascript">showWindow(\'login\', \'member.php?mod=logging&action=login&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()).(!empty($_G['gp_cookietime']) ? '&cookietime=1' : '').'\')</script>';
  23.                 showmessage('location_login', '', array('type' => 1), array('extrajs' => $js));
  24.         }

  25.         function on_login() {
  26.                 global $_G;
  27.                 if($_G['uid']) {
  28.                         $referer = dreferer();
  29.                         $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
  30.                         $param = array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['member']['uid']);
  31.                         showmessage('login_succeed', $referer ? $referer : './', $param, array('showdialog' => 1, 'locationtime' => true, 'extrajs' => $ucsynlogin));
  32.                 }

  33.                 $from_connect = $this->setting['connect']['allow'] && !empty($_G['gp_from']) ? 1 : 0;
  34.                 $seccodecheck = $from_connect ? false : $this->setting['seccodestatus'] & 2;
  35.                 $seccodestatus = !empty($_G['gp_lssubmit']) ? false : $seccodecheck;
  36.                 $invite = getinvite();

  37.                 if(!submitcheck('loginsubmit', 1, $seccodestatus)) {

  38.                         $auth = '';
  39.                         $username = !empty($_G['cookie']['loginuser']) ? htmlspecialchars($_G['cookie']['loginuser']) : '';

  40.                         if(!empty($_G['gp_auth'])) {
  41.                                 list($username, $password, $questionexist) = explode("\t", authcode($_G['gp_auth'], 'DECODE'));
  42.                                 $username = htmlspecialchars($username);
  43.                                 if($username && $password) {
  44.                                         $auth = htmlspecialchars($_G['gp_auth']);
  45.                                 } else {
  46.                                         $auth = '';
  47.                                 }
  48.                         }

  49.                         $cookietimecheck = !empty($_G['cookie']['cookietime']) || !empty($_G['gp_cookietime']) ? 'checked="checked"' : '';

  50.                         if($seccodecheck) {
  51.                                 $seccode = random(6, 1) + $seccode{0} * 1000000;
  52.                         }

  53.                         if($this->extrafile && file_exists(libfile('member/'.$this->extrafile, 'module'))) {
  54.                                 require_once libfile('member/'.$this->extrafile, 'module');
  55.                         }

  56.                         $navtitle = lang('core', 'title_login');
  57.                         include template($this->template);

  58.                 } else {

  59.                         if(!empty($_G['gp_auth'])) {
  60.                                 list($_G['gp_username'], $_G['gp_password']) = daddslashes(explode("\t", authcode($_G['gp_auth'], 'DECODE')));
  61.                         }

  62.                         if(!($_G['member_loginperm'] = logincheck($_G['gp_username']))) {
  63.                                 showmessage('login_strike');
  64.                         }
  65.                         if($_G['gp_fastloginfield']) {
  66.                                 $_G['gp_loginfield'] = $_G['gp_fastloginfield'];
  67.                         }
  68.                         $_G['uid'] = $_G['member']['uid'] = 0;
  69.                         $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
  70.                         if(!$_G['gp_password'] || $_G['gp_password'] != addslashes($_G['gp_password'])) {
  71.                                 showmessage('profile_passwd_illegal');
  72.                         }
  73.                         $result = userlogin($_G['gp_username'], $_G['gp_password'], $_G['gp_questionid'], $_G['gp_answer'], $this->setting['autoidselect'] ? 'auto' : $_G['gp_loginfield']);
  74.                         $uid = $result['ucresult']['uid'];

  75.                         if(!empty($_G['gp_lssubmit']) && ($result['ucresult']['uid'] == -3 || $seccodecheck && $result['status'] > 0)) {
  76.                                 $_G['gp_username'] = $result['ucresult']['username'];
  77.                                 $_G['gp_password'] = stripslashes($_G['gp_password']);
  78.                                 $this->logging_more($result['ucresult']['uid'] == -3);
  79.                         }

  80.                         if($result['status'] == -1) {
  81.                                 if(!$this->setting['fastactivation']) {
  82.                                         $auth = authcode($result['ucresult']['username']."\t".FORMHASH, 'ENCODE');
  83.                                         showmessage('location_activation', 'member.php?mod='.$this->setting['regname'].'&action=activation&auth='.rawurlencode($auth).'&referer='.rawurlencode(dreferer()), array(), array('location' => true));
  84.                                 } else {
  85.                                         $result = daddslashes($result);
  86.                                         $init_arr = explode(',', $this->setting['initcredits']);
  87.                                         DB::insert('common_member', array(
  88.                                                 'uid' => $uid,
  89.                                                 'username' => $result['ucresult']['username'],
  90.                                                 'password' => md5(random(10)),
  91.                                                 'email' => $result['ucresult']['email'],
  92.                                                 'adminid' => 0,
  93.                                                 'groupid' => $this->setting['regverify'] ? 8 : $this->setting['newusergroupid'],
  94.                                                 'regdate' => TIMESTAMP,
  95.                                                 'credits' => $init_arr[0],
  96.                                                 'timeoffset' => 9999
  97.                                         ));
  98.                                         DB::insert('common_member_status', array(
  99.                                                 'uid' => $uid,
  100.                                                 'regip' => $_G['clientip'],
  101.                                                 'lastip' => $_G['clientip'],
  102.                                                 'lastvisit' => TIMESTAMP,
  103.                                                 'lastactivity' => TIMESTAMP,
  104.                                                 'lastpost' => 0,
  105.                                                 'lastsendmail' => 0
  106.                                         ));
  107.                                         DB::insert('common_member_profile', array('uid' => $uid));
  108.                                         DB::insert('common_member_field_forum', array('uid' => $uid));
  109.                                         DB::insert('common_member_field_home', array('uid' => $uid));
  110.                                         DB::insert('common_member_count', array(
  111.                                                 'uid' => $uid,
  112.                                                 'extcredits1' => $init_arr[1],
  113.                                                 'extcredits2' => $init_arr[2],
  114.                                                 'extcredits3' => $init_arr[3],
  115.                                                 'extcredits4' => $init_arr[4],
  116.                                                 'extcredits5' => $init_arr[5],
  117.                                                 'extcredits6' => $init_arr[6],
  118.                                                 'extcredits7' => $init_arr[7],
  119.                                                 'extcredits8' => $init_arr[8]
  120.                                         ));
  121.                                         manyoulog('user', $uid, 'add');
  122.                                         $result['member'] = DB::fetch_first("SELECT * FROM ".DB::table('common_member')." WHERE uid='$uid'");
  123.                                         $result['status'] = 1;
  124.                                 }
  125.                         }

  126.                         if($result['status'] > 0) {

  127.                                 if($this->extrafile && file_exists(libfile('member/'.$this->extrafile, 'module'))) {
  128.                                         require_once libfile('member/'.$this->extrafile, 'module');
  129.                                 }

  130.                                 setloginstatus($result['member'], $_G['gp_cookietime'] ? 2592000 : 0);

  131.                                 DB::query("UPDATE ".DB::table('common_member_status')." SET lastip='".$_G['clientip']."', lastvisit='".time()."', lastactivity='".TIMESTAMP."' WHERE uid='$_G[uid]'");
  132.                                 $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';

  133.                                 if($invite['id']) {
  134.                                         $result = DB::result_first("SELECT COUNT(*) FROM ".DB::table('common_invite')." WHERE uid='$invite[uid]' AND fuid='$uid'");
  135.                                         if(!$result) {
  136.                                                 DB::update("common_invite", array('fuid'=>$uid, 'fusername'=>$_G['username']), array('id'=>$invite['id']));
  137.                                                 updatestat('invite');
  138.                                         } else {
  139.                                                 $invite = array();
  140.                                         }
  141.                                 }
  142.                                 if($invite['uid']) {
  143.                                         require_once libfile('function/friend');
  144.                                         friend_make($invite['uid'], $invite['username'], false);
  145.                                         dsetcookie('invite_auth', '');
  146.                                         if($invite['appid']) {
  147.                                                 updatestat('appinvite');
  148.                                         }
  149.                                 }

  150.                                 $param = array(
  151.                                         'username' => $result['ucresult']['username'],
  152.                                         'usergroup' => $_G['group']['grouptitle'],
  153.                                         'uid' => $_G['member']['uid'],
  154.                                         'groupid' => $_G['groupid'],
  155.                                         'syn' => $ucsynlogin ? 1 : 0
  156.                                 );

  157.                                 $extra = array(
  158.                                         'showdialog' => true,
  159.                                         'locationtime' => true,
  160.                                         'extrajs' => $ucsynlogin
  161.                                 );
  162.                                 $loginmessage = $_G['groupid'] == 8 ? 'login_succeed_inactive_member' : 'login_succeed';

  163.                                 $location = $invite || $_G['groupid'] == 8 ? 'home.php?mod=space&do=home' : dreferer();
  164.                                 if(empty($_G['gp_handlekey']) || !empty($_G['gp_lssubmit'])) {
  165.                                         if(defined('IN_MOBILE')) {
  166.                                                 showmessage('location_login_succeed_mobile', $location, array('username' => $result['ucresult']['username']), array('location' => true));
  167.                                         } else {
  168.                                                 if(!empty($_G['gp_lssubmit'])) {
  169.                                                         if(!$ucsynlogin) {
  170.                                                                 $extra['location'] = true;
  171.                                                         }
  172.                                                         showmessage($loginmessage, $location, $param, $extra);
  173.                                                 } else {
  174.                                                         $href = str_replace("'", "\'", $location);
  175.                                                         showmessage('location_login_succeed', $location, array(),
  176.                                                                 array(
  177.                                                                         'showid' => 'succeedmessage',
  178.                                                                         'extrajs' => '<script type="text/javascript">'.
  179.                                                                                 'setTimeout("window.location.href =\''.$href.'\';", 3000);'.
  180.                                                                                 '$(\'succeedmessage_href\').href = \''.$href.'\';'.
  181.                                                                                 '$(\'main_message\').style.display = \'none\';'.
  182.                                                                                 '$(\'main_succeed\').style.display = \'\';'.
  183.                                                                                 '$(\'succeedlocation\').innerHTML = \''.lang('message', $loginmessage, $param).'\';</script>'.$ucsynlogin,
  184.                                                                         'striptags' => false,
  185.                                                                 )
  186.                                                         );
  187.                                                 }
  188.                                         }
  189.                                 } else {
  190.                                         showmessage($loginmessage, $location, $param, $extra);
  191.                                 }
  192.                         } else {
  193.                                 $password = preg_replace("/^(.{".round(strlen($_G['gp_password']) / 4)."})(.+?)(.{".round(strlen($_G['gp_password']) / 6)."})$/s", "\\1***\\3", $_G['gp_password']);
  194.                                 $errorlog = dhtmlspecialchars(
  195.                                         TIMESTAMP."\t".
  196.                                         ($result['ucresult']['username'] ? $result['ucresult']['username'] : dstripslashes($_G['gp_username']))."\t".
  197.                                         $password."\t".
  198.                                         "Ques #".intval($_G['gp_questionid'])."\t".
  199.                                         $_G['clientip']);
  200.                                 writelog('illegallog', $errorlog);
  201.                                 loginfailed($_G['gp_username']);
  202.                                 $fmsg = $result['ucresult']['uid'] == '-3' ? (empty($_G['gp_questionid']) || $answer == '' ? 'login_question_empty' : 'login_question_invalid') : 'login_invalid';
  203.                                 showmessage($fmsg, '', array('loginperm' => $_G['member_loginperm']));
  204.                         }

  205.                 }

  206.         }

  207.         function on_logout() {
  208.                 global $_G;

  209.                 $ucsynlogout = $this->setting['allowsynlogin'] ? uc_user_synlogout() : '';

  210.                 if($_G['gp_formhash'] != $_G['formhash']) {
  211.                         showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
  212.                 }

  213.                 clearcookies();
  214.                 $_G['groupid'] = $_G['member']['groupid'] = 7;
  215.                 $_G['uid'] = $_G['member']['uid'] = 0;
  216.                 $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
  217.                 $_G['setting']['styleid'] = $this->setting['styleid'];

  218.                 showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
  219.         }

  220. }

  221. class register_ctl {

  222.         var $showregisterform = 1;

  223.         function register_ctl() {
  224.                 global $_G;
  225.                 if($_G['setting']['bbclosed']) {
  226.                         if(($_G['gp_action'] != 'activation' && !$_G['gp_activationauth']) || !$_G['setting']['closedallowactivation'] ) {
  227.                                 showmessage('register_disable', NULL, array(), array('login' => 1));
  228.                         }
  229.                 }

  230.                 loadcache(array('modreasons', 'stamptypeid', 'fields_required', 'fields_optional', 'fields_register', 'ipctrl'));
  231.                 require_once libfile('function/misc');
  232.                 require_once libfile('function/profile');
  233.                 if(!function_exists('sendmail')) {
  234.                         include libfile('function/mail');
  235.                 }
  236.                 loaducenter();
  237.         }

  238.         function on_register() {
  239.                 global $_G;

  240.                 $_G['gp_username'] = $_G['gp_'.$this->setting['reginput']['username']];
  241.                 $_G['gp_password'] = $_G['gp_'.$this->setting['reginput']['password']];
  242.                 $_G['gp_password2'] = $_G['gp_'.$this->setting['reginput']['password2']];
  243.                 $_G['gp_email'] = $_G['gp_'.$this->setting['reginput']['email']];

  244.                 if($_G['uid']) {
  245.                         $ucsynlogin = $this->setting['allowsynlogin'] ? uc_user_synlogin($_G['uid']) : '';
  246.                         $url_forward = dreferer();
  247.                         if(strpos($url_forward, $this->setting['regname']) !== false) {
  248.                                 $url_forward = 'forum.php';
  249.                         }
  250.                         showmessage('login_succeed', $url_forward ? $url_forward : './', array('username' => $_G['member']['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']), array('extrajs' => $ucsynlogin));
  251.                 } elseif(!$this->setting['regclosed'] && (!$this->setting['regstatus'] || !$this->setting['ucactivation'])) {
  252.                         if($_G['gp_action'] == 'activation' || $this->setting['gp_activationauth']) {
  253.                                 if(!$this->setting['ucactivation'] && !$this->setting['closedallowactivation']) {
  254.                                         showmessage('register_disable_activation');
  255.                                 }
  256.                         } elseif(!$this->setting['regstatus']) {
  257.                                 showmessage(!$this->setting['regclosemessage'] ? 'register_disable' : str_replace(array("\r", "\n"), '', $this->setting['regclosemessage']));
  258.                         }
  259.                 }

  260.                 $bbrules = & $this->setting['bbrules'];
  261.                 $bbrulesforce = & $this->setting['bbrulesforce'];
  262.                 $bbrulestxt = & $this->setting['bbrulestxt'];
  263.                 $welcomemsg = & $this->setting['welcomemsg'];
  264.                 $welcomemsgtitle = & $this->setting['welcomemsgtitle'];
  265.                 $welcomemsgtxt = & $this->setting['welcomemsgtxt'];
  266.                 $regname = $this->setting['regname'];

  267.                 if($this->setting['regverify']) {
  268.                         if($this->setting['areaverifywhite']) {
  269.                                 $location = $whitearea = '';
  270.                                 $location = trim(convertip($_G['clientip'], "./"));
  271.                                 if($location) {
  272.                                         $whitearea = preg_quote(trim($this->setting['areaverifywhite']), '/');
  273.                                         $whitearea = str_replace(array("\\*"), array('.*'), $whitearea);
  274.                                         $whitearea = '.*'.$whitearea.'.*';
  275.                                         $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i';
  276.                                         if(@preg_match($whitearea, $location)) {
  277.                                                 $this->setting['regverify'] = 0;
  278.                                         }
  279.                                 }
  280.                         }

  281.                         if($_G['cache']['ipctrl']['ipverifywhite']) {
  282.                                 foreach(explode("\n", $_G['cache']['ipctrl']['ipverifywhite']) as $ctrlip) {
  283.                                         if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
  284.                                                 $this->setting['regverify'] = 0;
  285.                                                 break;
  286.                                         }
  287.                                 }
  288.                         }
  289.                 }

  290.                 $invitestatus = false;
  291.                 if($this->setting['regstatus'] == 2) {
  292.                         if($this->setting['inviteconfig']['inviteareawhite']) {
  293.                                 $location = $whitearea = '';
  294.                                 $location = trim(convertip($_G['clientip'], "./"));
  295.                                 if($location) {
  296.                                         $whitearea = preg_quote(trim($this->setting['inviteconfig']['inviteareawhite']), '/');
  297.                                         $whitearea = str_replace(array("\\*"), array('.*'), $whitearea);
  298.                                         $whitearea = '.*'.$whitearea.'.*';
  299.                                         $whitearea = '/^('.str_replace(array("\r\n", ' '), array('.*|.*', ''), $whitearea).')$/i';
  300.                                         if(@preg_match($whitearea, $location)) {
  301.                                                 $invitestatus = true;
  302.                                         }
  303.                                 }
  304.                         }

  305.                         if($this->setting['inviteconfig']['inviteipwhite']) {
  306.                                 foreach(explode("\n", $this->setting['inviteconfig']['inviteipwhite']) as $ctrlip) {
  307.                                         if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
  308.                                                 $invitestatus = true;
  309.                                                 break;
  310.                                         }
  311.                                 }
  312.                         }
  313.                 }

  314.                 $groupinfo = array();
  315.                 if($this->setting['regverify']) {
  316.                         $groupinfo['groupid'] = 8;
  317.                 } else {
  318.                         $groupinfo['groupid'] = $this->setting['newusergroupid'];
  319.                 }

  320.                 $seccodecheck = $this->setting['seccodestatus'] & 1;
  321.                 $secqaacheck = $this->setting['secqaa']['status'] & 1;
  322.                 $fromuid = !empty($_G['cookie']['promotion']) && $this->setting['creditspolicy']['promotion_register'] ? intval($_G['cookie']['promotion']) : 0;
  323.                 $username = isset($_G['gp_username']) ? $_G['gp_username'] : '';
  324.                 $bbrulehash = $bbrules ? substr(md5(FORMHASH), 0, 8) : '';
  325.                 $auth = $_G['gp_auth'];

  326.                 if(!$invitestatus) {
  327.                         $invite = getinvite();
  328.                 }

  329.                 if(!submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck)) {

  330.                         if($_G['gp_action'] == 'activation') {
  331.                                 $auth = explode("\t", authcode($auth, 'DECODE'));
  332.                                 if(FORMHASH != $auth[1]) {
  333.                                         showmessage('register_activation_invalid', 'member.php?mod=logging&action=login');
  334.                                 }
  335.                                 $username = $auth[0];
  336.                                 $activationauth = authcode("$auth[0]\t".FORMHASH, 'ENCODE');
  337.                         }

  338.                         if($fromuid) {
  339.                                 $query = DB::query("SELECT username FROM ".DB::table('common_member')." WHERE uid='$fromuid'");
  340.                                 if(DB::num_rows($query)) {
  341.                                         $fromuser = dhtmlspecialchars(DB::result($query, 0));
  342.                                 } else {
  343.                                         dsetcookie('promotion');
  344.                                 }
  345.                         }

  346.                         $bbrulestxt = nl2br("\n$bbrulestxt\n\n");
  347.                         if($_G['gp_action'] == 'activation') {
  348.                                 $auth = dhtmlspecialchars($auth);
  349.                         }

  350.                         if($seccodecheck) {
  351.                                 $seccode = random(6, 1);
  352.                         }

  353.                         $username = dhtmlspecialchars($username);

  354.                         $htmls = $settings = array();
  355.                         foreach($_G['cache']['fields_register'] as $field) {
  356.                                 $fieldid = $field['fieldid'];
  357.                                 $html = profile_setting($fieldid, array(), false, false, true);
  358.                                 if($html) {
  359.                                         $settings[$fieldid] = $_G['cache']['profilesetting'][$fieldid];
  360.                                         $htmls[$fieldid] = $html;
  361.                                 }
  362.                         }

  363.                         $navtitle = $this->setting['reglinkname'];

  364.                         if($this->extrafile && file_exists(libfile('member/'.$this->extrafile, 'module'))) {
  365.                                 require_once libfile('member/'.$this->extrafile, 'module');
  366.                         }

  367.                         $dreferer = dreferer();

  368.                         include template($this->template);

  369.                 } else {

  370.                         if($this->setting['regstatus'] == 2 && empty($invite) && !$invitestatus) {
  371.                                 showmessage('not_open_registration_invite');
  372.                         }

  373.                         if($bbrules && $bbrulehash != $_POST['agreebbrule']) {
  374.                                 showmessage('register_rules_agree');
  375.                         }

  376.                         $activation = array();
  377.                         if(isset($_G['gp_activationauth'])) {
  378.                                 $activationauth = explode("\t", authcode($_G['gp_activationauth'], 'DECODE'));
  379.                                 if($activationauth[1] == FORMHASH && !($activation = daddslashes(uc_get_user($activationauth[0]), 1))) {
  380.                                         showmessage('register_activation_invalid', 'member.php?mod=logging&action=login');
  381.                                 }
  382.                         }

  383.                         if(!$activation) {
  384.                                 $usernamelen = dstrlen($username);
  385.                                 if($usernamelen < 3) {
  386.                                         showmessage('profile_username_tooshort');
  387.                                 } elseif($usernamelen > 15) {
  388.                                         showmessage('profile_username_toolong');
  389.                                 }
  390.                                 $username = addslashes(trim(dstripslashes($username)));
  391.                                 if(uc_get_user($username) && !DB::result_first("SELECT uid FROM ".DB::table('common_member')." WHERE username='$username'")) {
  392.                                         if($_G['inajax']) {
  393.                                                 showmessage('profile_username_duplicate');
  394.                                         } else {
  395.                                                 showmessage('register_activation_message', 'member.php?mod=logging&action=login', array('username' => stripslashes($username)));
  396.                                         }
  397.                                 }
  398.                                 $email = trim($_G['gp_email']);
  399.                                 if(empty($this->setting['ignorepassword'])) {
  400.                                         if($_G['gp_password'] !== $_G['gp_password2']) {
  401.                                                 showmessage('profile_passwd_notmatch');
  402.                                         }

  403.                                         if(!$_G['gp_password'] || $_G['gp_password'] != addslashes($_G['gp_password'])) {
  404.                                                 showmessage('profile_passwd_illegal');
  405.                                         }
  406.                                         $password = $_G['gp_password'];
  407.                                 } else {
  408.                                         $password = md5(random(10));
  409.                                 }
  410.                         }
  411. // YucMedia Captcha Start
  412. require_once DISCUZ_ROOT.'./source/include/Yuc_Captcha/yucmedia.php';
  413. $yucmedia_sitekey="5mk3y3rg1umk378qidi0manfg";
  414. $yucmedia_idenkey="i08x5eav8c6dsdttpqgg6hxhf";
  415. $yucmedia_userip=$_SERVER["REMOTE_ADDR"];  
  416. $yucmedia_userinput=$_POST['yucmedia_checkcode'];
  417. $yucmedia_serialnum=$_POST['BMserialnum'];
  418. $yucmedia_zbkey='zphp';
  419. $yucmedia_result=yucmedia_verify($yucmedia_sitekey, $yucmedia_userip, $yucmedia_serialnum, $yucmedia_userinput, $yucmedia_idenkey, $yucmedia_zbkey);
  420. if (substr($yucmedia_result,0,4)!='true') {
  421.           showmessage("验证码输入错误,请重新输入!");
  422.         }
  423. // YucMedia Captcha End
  424.                         $censorexp = '/^('.str_replace(array('\\*', "\r\n", ' '), array('.*', '|', ''), preg_quote(($this->setting['censoruser'] = trim($this->setting['censoruser'])), '/')).')$/i';

  425.                         if($this->setting['censoruser'] && @preg_match($censorexp, $username)) {
  426.                                 showmessage('profile_username_protect');
  427.                         }

  428.                         if($this->setting['regverify'] == 2 && !trim($_G['gp_regmessage'])) {
  429.                                 showmessage('profile_required_info_invalid');
  430.                         }

  431.                         if($_G['cache']['ipctrl']['ipregctrl']) {
  432.                                 foreach(explode("\n", $_G['cache']['ipctrl']['ipregctrl']) as $ctrlip) {
  433.                                         if(preg_match("/^(".preg_quote(($ctrlip = trim($ctrlip)), '/').")/", $_G['clientip'])) {
  434.                                                 $ctrlip = $ctrlip.'%';
  435.                                                 $this->setting['regctrl'] = $this->setting['ipregctrltime'];
  436.                                                 break;
  437.                                         } else {
  438.                                                 $ctrlip = $_G['clientip'];
  439.                                         }
  440.                                 }
  441.                         } else {
  442.                                 $ctrlip = $_G['clientip'];
  443.                         }

  444.                         if($this->setting['regctrl']) {
  445.                                 $query = DB::query("SELECT ip FROM ".DB::table('common_regip')." WHERE ip LIKE '$ctrlip' AND count='-1' AND dateline>$_G[timestamp]-'".$this->setting['regctrl']."'*3600 LIMIT 1");
  446.                                 if(DB::num_rows($query)) {
  447.                                         showmessage('register_ctrl', NULL, array('regctrl' => $this->setting['regctrl']));
  448.                                 }
  449.                         }

  450.                         $regipsql = '';
  451.                         if($this->setting['regfloodctrl']) {
  452.                                 if($regattempts = DB::result_first("SELECT count FROM ".DB::table('common_regip')." WHERE ip='$_G[clientip]' AND count>'0' AND dateline>'$_G[timestamp]'-86400")) {
  453.                                         if($regattempts >= $this->setting['regfloodctrl']) {
  454.                                                 showmessage('register_flood_ctrl', NULL, array('regfloodctrl' => $this->setting['regfloodctrl']));
  455.                                         } else {
  456.                                                 $regipsql = "UPDATE ".DB::table('common_regip')." SET count=count+1 WHERE ip='$_G[clientip]' AND count>'0'";
  457.                                         }
  458.                                 } else {
  459.                                         $regipsql = "INSERT INTO ".DB::table('common_regip')." (ip, count, dateline)
  460.                                                 VALUES ('$_G[clientip]', '1', '$_G[timestamp]')";
  461.                                 }
  462.                         }

  463.                         $profile = $verifyarr = array();
  464.                         foreach($_G['cache']['fields_register'] as $field) {
  465.                                 if(defined('IN_MOBILE')) {
  466.                                         break;
  467.                                 }
  468.                                 $field_key = $field['fieldid'];
  469.                                 $field_val = $_G['gp_'.$field_key];
  470.                                 if($field['formtype'] == 'file' && !empty($_FILES[$field_key]) && $_FILES[$field_key]['error'] == 0) {
  471.                                         $field_val = true;
  472.                                 }

  473.                                 if(!profile_check($field_key, $field_val)) {
  474.                                         $showid = !in_array($field['fieldid'], array('birthyear', 'birthmonth')) ? $field['fieldid'] : 'birthday';
  475.                                         showmessage($field['title'].lang('message', 'profile_illegal'), '', array(), array(
  476.                                                 'showid' => 'chk_'.$showid,
  477.                                                 'extrajs' => $field['title'].lang('message', 'profile_illegal').($field['formtype'] == 'text' ? '<script type="text/javascript">'.
  478.                                                         '$(\'registerform\').'.$field['fieldid'].'.className = \'px er\';'.
  479.                                                         '$(\'registerform\').'.$field['fieldid'].'.onblur = function () { if(this.value != \'\') {this.className = \'px\';$(\'chk_'.$showid.'\').innerHTML = \'\';}}'.
  480.                                                         '</script>' : '')
  481.                                         ));
  482.                                 }
  483.                                 if($field['needverify']) {
  484.                                         $verifyarr[$field_key] = $field_val;
  485.                                 } else {
  486.                                         $profile[$field_key] = $field_val;
  487.                                 }
  488.                         }

  489.                         if(!$activation) {
  490.                                 $uid = uc_user_register($username, $password, $email, $questionid, $answer, $_G['clientip']);

  491.                                 if($uid <= 0) {
  492.                                         if($uid == -1) {
  493.                                                 showmessage('profile_username_illegal');
  494.                                         } elseif($uid == -2) {
  495.                                                 showmessage('profile_username_protect');
  496.                                         } elseif($uid == -3) {
  497.                                                 showmessage('profile_username_duplicate');
  498.                                         } elseif($uid == -4) {
  499.                                                 showmessage('profile_email_illegal');
  500.                                         } elseif($uid == -5) {
  501.                                                 showmessage('profile_email_domain_illegal');
  502.                                         } elseif($uid == -6) {
  503.                                                 showmessage('profile_email_duplicate');
  504.                                         } else {
  505.                                                 showmessage('undefined_action');
  506.                                         }
  507.                                 }
  508.                         } else {
  509.                                 list($uid, $username, $email) = $activation;
  510.                         }
  511.                         $_G['username'] = $username;
  512.                         if(DB::result_first("SELECT uid FROM ".DB::table('common_member')." WHERE uid='$uid'")) {
  513.                                 if(!$activation) {
  514.                                         uc_user_delete($uid);
  515.                                 }
  516.                                 showmessage('profile_uid_duplicate', '', array('uid' => $uid));
  517.                         }

  518.                         $password = md5(random(10));
  519.                         $secques = $questionid > 0 ? random(8) : '';

  520.                         if(isset($_POST['birthmonth']) && isset($_POST['birthday'])) {
  521.                                 $profile['constellation'] = get_constellation($_POST['birthmonth'], $_POST['birthday']);
  522.                         }
  523.                         if(isset($_POST['birthyear'])) {
  524.                                 $profile['zodiac'] = get_zodiac($_POST['birthyear']);
  525.                         }

  526.                         if($_FILES) {
  527.                                 require_once libfile('class/upload');
  528.                                 $upload = new discuz_upload();

  529.                                 foreach($_FILES as $key => $file) {
  530.                                         $field_key = 'field_'.$key;
  531.                                         if(!empty($_G['cache']['fields_register'][$field_key]) && $_G['cache']['fields_register'][$field_key]['formtype'] == 'file') {

  532.                                                 $upload->init($file, 'profile');
  533.                                                 $attach = $upload->attach;

  534.                                                 if(!$upload->error()) {
  535.                                                         $upload->save();

  536.                                                         if(!$upload->get_image_info($attach['target'])) {
  537.                                                                 @unlink($attach['target']);
  538.                                                                 continue;
  539.                                                         }

  540.                                                         $attach['attachment'] = dhtmlspecialchars(trim($attach['attachment']));
  541.                                                         if($_G['cache']['fields_register'][$field_key]['needverify']) {
  542.                                                                 $verifyarr[$key] = $attach['attachment'];
  543.                                                         } else {
  544.                                                                 $profile[$key] = $attach['attachment'];
  545.                                                         }
  546.                                                 }
  547.                                         }
  548.                                 }
  549.                         }

  550.                         if($regipsql) {
  551.                                 DB::query($regipsql);
  552.                         }

  553.                         if($invite && $this->setting['inviteconfig']['invitegroupid']) {
  554.                                 $groupinfo['groupid'] = $this->setting['inviteconfig']['invitegroupid'];
  555.                         }

  556.                         $init_arr = explode(',', $this->setting['initcredits']);
  557.                         $userdata = array(
  558.                                 'uid' => $uid,
  559.                                 'username' => $username,
  560.                                 'password' => $password,
  561.                                 'email' => $email,
  562.                                 'adminid' => 0,
  563.                                 'groupid' => $groupinfo['groupid'],
  564.                                 'regdate' => TIMESTAMP,
  565.                                 'credits' => $init_arr[0],
  566.                                 'timeoffset' => 9999
  567.                         );
  568.                         $status_data = array(
  569.                                 'uid' => $uid,
  570.                                 'regip' => $_G['clientip'],
  571.                                 'lastip' => $_G['clientip'],
  572.                                 'lastvisit' => TIMESTAMP,
  573.                                 'lastactivity' => TIMESTAMP,
  574.                                 'lastpost' => 0,
  575.                                 'lastsendmail' => 0,
  576.                         );
  577.                         $profile['uid'] = $uid;
  578.                         $field_forum['uid'] = $uid;
  579.                         $field_home['uid'] = $uid;

  580.                         if($this->extrafile && file_exists(libfile('member/'.$this->extrafile, 'module'))) {
  581.                                 require_once libfile('member/'.$this->extrafile, 'module');
  582.                         }

  583.                         DB::insert('common_member', $userdata);
  584.                         DB::insert('common_member_status', $status_data);
  585.                         DB::insert('common_member_profile', $profile);
  586.                         DB::insert('common_member_field_forum', $field_forum);
  587.                         DB::insert('common_member_field_home', $field_home);

  588.                         if($verifyarr) {
  589.                                 $setverify = array(
  590.                                         'uid' => $uid,
  591.                                         'username' => $username,
  592.                                         'verifytype' => '0',
  593.                                         'field' => daddslashes(serialize($verifyarr)),
  594.                                         'dateline' => TIMESTAMP,
  595.                                 );
  596.                                 DB::insert('common_member_verify_info', $setverify);
  597.                                 DB::insert('common_member_verify', array('uid' => $uid));
  598.                         }

  599.                         $count_data = array(
  600.                                 'uid' => $uid,
  601.                                 'extcredits1' => $init_arr[1],
  602.                                 'extcredits2' => $init_arr[2],
  603.                                 'extcredits3' => $init_arr[3],
  604.                                 'extcredits4' => $init_arr[4],
  605.                                 'extcredits5' => $init_arr[5],
  606.                                 'extcredits6' => $init_arr[6],
  607.                                 'extcredits7' => $init_arr[7],
  608.                                 'extcredits8' => $init_arr[8]
  609.                         );
  610.                         DB::insert('common_member_count', $count_data);
  611.                         DB::insert('common_setting', array('skey' => 'lastmember', 'svalue' => $username), false, true);
  612.                         manyoulog('user', $uid, 'add');

  613.                         $totalmembers = DB::result_first("SELECT COUNT(*) FROM ".DB::table('common_member'));
  614.                         $userstats = array('totalmembers' => $totalmembers, 'newsetuser' => stripslashes($username));

  615.                         save_syscache('userstats', $userstats);

  616.                         if($this->setting['regctrl'] || $this->setting['regfloodctrl']) {
  617.                                 DB::query("DELETE FROM ".DB::table('common_regip')." WHERE dateline<='$_G[timestamp]'-".($this->setting['regctrl'] > 72 ? $this->setting['regctrl'] : 72)."*3600", 'UNBUFFERED');
  618.                                 if($this->setting['regctrl']) {
  619.                                         DB::query("INSERT INTO ".DB::table('common_regip')." (ip, count, dateline)
  620.                                                 VALUES ('$_G[clientip]', '-1', '$_G[timestamp]')");
  621.                                 }
  622.                         }

  623.                         $regmessage = dhtmlspecialchars($_G['gp_regmessage']);
  624.                         if($this->setting['regverify'] == 2) {
  625.                                 DB::query("REPLACE INTO ".DB::table('common_member_validate')." (uid, submitdate, moddate, admin, submittimes, status, message, remark)
  626.                                         VALUES ('$uid', '$_G[timestamp]', '0', '', '1', '0', '$regmessage', '')");
  627.                                 manage_addnotify('verifyuser');
  628.                         }

  629.                         setloginstatus(array(
  630.                                 'uid' => $uid,
  631.                                 'username' => dstripslashes($_G['username']),
  632.                                 'password' => $password,
  633.                                 'groupid' => $groupinfo['groupid'],
  634.                         ), 0);
  635.                         include_once libfile('function/stat');
  636.                         updatestat('register');

  637.                         if($invite['id']) {
  638.                                 $result = DB::result_first("SELECT COUNT(*) FROM ".DB::table('common_invite')." WHERE uid='$invite[uid]' AND fuid='$uid'");
  639.                                 if(!$result) {
  640.                                         DB::update("common_invite", array('fuid'=>$uid, 'fusername'=>$_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2), array('id'=>$invite['id']));
  641.                                         updatestat('invite');
  642.                                 } else {
  643.                                         $invite = array();
  644.                                 }
  645.                         }
  646.                         if($invite['uid']) {
  647.                                 if($this->setting['inviteconfig']['inviteaddcredit']) {
  648.                                         updatemembercount($uid, array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['inviteaddcredit']));
  649.                                 }
  650.                                 if($this->setting['inviteconfig']['invitedaddcredit']) {
  651.                                         updatemembercount($invite['uid'], array($this->setting['inviteconfig']['inviterewardcredit'] => $this->setting['inviteconfig']['invitedaddcredit']));
  652.                                 }
  653.                                 require_once libfile('function/friend');
  654.                                 friend_make($invite['uid'], $invite['username'], false);
  655.                                 notification_add($invite['uid'], 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid='.$invite['uid'].'" target="_blank">'.$invite['username'].'</a>'), 1);

  656.                                 space_merge($invite, 'field_home');
  657.                                 if(!empty($invite['privacy']['feed']['invite'])) {
  658.                                         require_once libfile('function/feed');
  659.                                         $tite_data = array('username' => '<a href="home.php?mod=space&uid='.$_G['uid'].'">'.$_G['username'].'</a>');
  660.                                         feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $invite['uid'], $invite['username']);
  661.                                 }
  662.                                 if($invite['appid']) {
  663.                                         updatestat('appinvite');
  664.                                 }
  665.                         }

  666.                         if($welcomemsg && !empty($welcomemsgtxt)) {
  667.                                 $welcomemsgtitle = addslashes(replacesitevar($welcomemsgtitle));
  668.                                 $welcomemsgtxt = addslashes(replacesitevar($welcomemsgtxt));
  669.                                 if($welcomemsg == 1) {
  670.                                         $welcomemsgtxt = nl2br(str_replace(':', '&#58;', $welcomemsgtxt));
  671.                                         notification_add($uid, 'system', $welcomemsgtxt, array(), 1);
  672.                                 } elseif($welcomemsg == 2) {
  673.                                         sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt);
  674.                                 } elseif($welcomemsg == 3) {
  675.                                         sendmail_cron($email, $welcomemsgtitle, $welcomemsgtxt);
  676.                                         $welcomemsgtxt = nl2br(str_replace(':', '&#58;', $welcomemsgtxt));
  677.                                         notification_add($uid, 'system', $welcomemsgtxt, array(), 1);
  678.                                 }
  679.                         }

  680.                         if($fromuid) {
  681.                                 updatecreditbyaction('promotion_register', $fromuid);
  682.                                 dsetcookie('promotion', '');
  683.                         }
  684.                         dsetcookie('loginuser', '');
  685.                         dsetcookie('activationauth', '');
  686.                         dsetcookie('invite_auth', '');

  687.                         loadcache('setting', true);
  688.                         $_G['setting']['lastmember'] = stripslashes($username);
  689.                         $settingnew = $_G['setting'];
  690.                         $settingnew['pluginhooks'] = array();
  691.                         save_syscache('setting', $settingnew);

  692.                         switch($this->setting['regverify']) {
  693.                                 case 1:
  694.                                         $idstring = random(6);
  695.                                         $authstr = $this->setting['regverify'] == 1 ? "$_G[timestamp]\t2\t$idstring" : '';
  696.                                         DB::query("UPDATE ".DB::table('common_member_field_forum')." SET authstr='$authstr' WHERE uid='$_G[uid]'");
  697.                                         $verifyurl = "{$_G[siteurl]}member.php?mod=activate&amp;uid={$_G[uid]}&amp;id=$idstring";
  698.                                         $email_verify_message = lang('email', 'email_verify_message', array(
  699.                                                 'username' => $_G['member']['username'],
  700.                                                 'bbname' => $this->setting['bbname'],
  701.                                                 'siteurl' => $_G['siteurl'],
  702.                                                 'url' => $verifyurl
  703.                                         ));
  704.                                         sendmail("$username <$email>", lang('email', 'email_verify_subject'), $email_verify_message);
  705.                                         $message = 'register_email_verify';
  706.                                         $locationmessage = 'register_email_verify_location';
  707.                                         $url_forward = dreferer();
  708.                                         break;
  709.                                 case 2:
  710.                                         $message = 'register_manual_verify';
  711.                                         $locationmessage = 'register_manual_verify_location';
  712.                                         $url_forward = $_G['setting']['homestatus'] ? 'home.php?mod=space&do=home' : 'home.php?mod=spacecp';
  713.                                         break;
  714.                                 default:
  715.                                         $message = 'register_succeed';
  716.                                         $locationmessage = 'register_succeed_location';
  717.                                         $url_forward = dreferer();
  718.                                         break;
  719.                         }
  720.                         $param = array('bbname' => $this->setting['bbname'], 'username' => $_G['username'], 'usergroup' => $_G['group']['grouptitle'], 'uid' => $_G['uid']);
  721.                         if(strpos($url_forward, $this->setting['regname']) !== false || strpos($url_forward, 'buyinvitecode') !== false) {
  722.                                 $url_forward = 'forum.php';
  723.                         }
  724.                         $href = str_replace("'", "\'", $url_forward);
  725.                         $extra = array(
  726.                                 'showid' => 'succeedmessage',
  727.                                 'extrajs' => '<script type="text/javascript">'.
  728.                                         'setTimeout("window.location.href =\''.$href.'\';", 3000);'.
  729.                                         '$(\'succeedmessage_href\').href = \''.$href.'\';'.
  730.                                         '$(\'main_message\').style.display = \'none\';'.
  731.                                         '$(\'main_succeed\').style.display = \'\';'.
  732.                                         '$(\'succeedlocation\').innerHTML = \''.lang('message', $locationmessage).'\';'.
  733.                                 '</script>',
  734.                                 'striptags' => false,
  735.                         );
  736.                         showmessage($message, $url_forward, $param, $extra);
  737.                 }




  738.         }

  739. }

  740. ?>
复制代码
回复

使用道具 举报

大大乔侨 发表于 2012-5-6 09:19:03 | 显示全部楼层
验证内容可以自己改么?感觉那些广告能改成自己需要的就好了
回复

使用道具 举报

cbccn 发表于 2012-5-6 11:41:56 | 显示全部楼层
回帖是必须的,这个可以有!!!
www.phb1.cn
回复

使用道具 举报

zckspk1 发表于 2012-5-13 01:53:33 | 显示全部楼层
如何实现本地站点广告图片效果?
因为不想帮别人打无偿的广告.
回复

使用道具 举报

可爱情侣装 发表于 2012-5-13 02:41:06 | 显示全部楼层
说是插件?后台应用没有这个安装提示啊
回复

使用道具 举报

www.w25.com 发表于 2012-5-13 09:55:14 | 显示全部楼层
牛屎((em:08))
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-11-22 15:14 , Processed in 0.134376 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表