Esempio n. 1
0
         }
     }
 }
 if (DISCUZ_VERSION < 'X3.0' && $_G['inajax']) {
     $_GET['username'] = WeChatEmoji::clear($_GET['username']);
 }
 if ($ac == 'wxregister') {
     loaducenter();
     $user = uc_get_user($_GET['username']);
     if (!empty($user)) {
         $_GET['username'] = cutstr($_GET['username'], 7, '') . '_' . random(5);
     }
 }
 $uid = WeChat::register($_GET['username'], $ac == 'wxregister');
 if ($uid && $_GET['avatar']) {
     WeChat::syncAvatar($uid, $_GET['avatar']);
 }
 if (!$_G['wechat']['setting']['wechat_qrtype']) {
     WeChatHook::bindOpenId($uid, $openid, 1);
     wsq::report('register');
     showmessage('wechat:wechat_member_register_succeed', $selfurl . 'bind&confirm=yes');
 } else {
     C::t('#wechat#common_member_wechatmp')->insert(array('uid' => $uid, 'openid' => $wxopenid ? $wxopenid : $_GET['wxopenid'], 'status' => 0), false, true);
     wsq::report('register');
     $url = wsq::wxuserregisterUrl($uid);
     if ($ac == 'wxregister') {
         dheader('location: ' . $url);
     } else {
         showmessage('wechat:wechat_member_register_succeed', $url);
     }
 }