예제 #1
0
파일: wechat.inc.php 프로젝트: cwcw/cms
    $_GET['username'] = substr(WeChatEmoji::clear($_GET['username']), 0, 15);
}
if ($ac == 'bind') {
    define('IN_MOBILE', 2);
    if ($_G['wechat']['setting']['wechat_mtype'] == 2) {
        $defaultusername = WeChat::getnewname($openid);
    } else {
        $defaultusername = $_G['wechat']['setting']['wechat_qrtype'] ? $_GET['username'] : '******' . random(5);
    }
    $defaultusername = htmlspecialchars($defaultusername);
    $connecturl = $_G['setting']['connect']['allow'] && !$_G['setting']['bbclosed'] ? $_G['siteurl'] . 'connect.php?mod=login&op=init&referer=' . urlencode($selfurl . 'qqbind') . '&statfrom=login_simple' : '';
    if (IN_WECHAT) {
        if (!$_G['uid']) {
            include template('wechat:wechat_bind');
        } else {
            $redirect = WeChat::redirect();
            if ($redirect) {
                dheader('location: ' . $redirect);
            } else {
                dheader('location: ' . $_G['siteurl']);
            }
        }
    } else {
        dheader('location: ' . $_G['siteurl'] . 'member.php?mod=logging&action=login&referer=' . dreferer());
    }
} elseif ($ac == 'login' && submitcheck('submit')) {
    if (!($loginperm = logincheck($_GET['username']))) {
        showmessage('login_strike');
    }
    if (!$_GET['password'] || $_GET['password'] != addslashes($_GET['password'])) {
        showmessage('profile_passwd_illegal');
예제 #2
0
 function common()
 {
     global $_G;
     if (!$_G['wechat']['setting']) {
         $_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
     }
     dsetcookie('mobile', '', -1);
     if (!isset($_GET['pluginid'])) {
         $redirect = WeChat::redirect(1);
         if ($redirect) {
             dheader('location: ' . $redirect);
         }
     }
 }
예제 #3
0
 function common()
 {
     global $_G;
     dsetcookie('mobile', '', -1);
     $redirect = WeChat::redirect(1);
     if ($redirect) {
         dheader('location: ' . $redirect);
     }
 }