示例#1
0
                $saveInfo = array('account' => $oauthInfo['id'], 'nickname' => $oauthInfo['name'], 'gender' => strtoupper($oauthInfo['basicInformation']['sex']) == 'MALE' ? '男' : '女', 'type' => $_REQUEST['state']);
                break;
            case 'douban':
                $oauthInfo = $oauth_obj->getAccountInfo();
                unset($oauth_obj, $_SESSION['oauth_token']);
                $saveInfo = array('account' => $oauthInfo['id'], 'nickname' => $oauthInfo['name'], 'gender' => '', 'type' => $_REQUEST['state']);
                break;
            case 'taobao':
                $saveInfo = array('account' => $token['taobao_user_id'], 'nickname' => urldecode($token['taobao_user_nick']), 'gender' => $token['taobao_user_gender'], 'type' => $_REQUEST['state']);
                break;
            case 'baidu':
                $oauthInfo = $oauth_obj->getAccountInfo($token);
                unset($oauth_obj, $_SESSION['oauth_token']);
                $saveInfo = array('account' => $oauthInfo['userid'], 'nickname' => $oauthInfo['username'], 'gender' => $oauthInfo['sex'] ? '男' : '女', 'type' => $_REQUEST['state']);
                break;
            default:
                break;
        }
        if ($gUid) {
            UserCenter::bindingAccount($gUid, $gUserInfo['username'], $saveInfo);
            header('Location:' . $basic_config['website_url'] . '/index.php?do=user&view=account&op=binding');
        } else {
            $_SESSION[$saveInfo['type'] . '_oauthInfo'] = $saveInfo;
            header('Location:' . $basic_config['website_url'] . '/index.php?do=oauthregister&type=' . $saveInfo['type']);
        }
    } else {
        exit('授权失败');
    }
} else {
    exit('参数错误');
}
示例#2
0
}
$objLogin = new keke_user_login_class();
$arrBindInfo = keke_register_class::is_oauth_bind($type, $arrOauthInfo['account']);
if ($_SESSION[$type . '_oauthInfo'] && $arrBindInfo) {
    $_SESSION[$type . '_oauthInfo'] = null;
    $arrUserInfo = kekezu::get_user_info($arrBindInfo['uid']);
    $loginUserInfo = $objLogin->oauth_user_login($arrUserInfo['username'], $arrUserInfo['password'], null, 1);
    $objLogin->save_user_info($loginUserInfo, 1);
}
$inter = $kekezu->_sys_config['user_intergration'];
$intLoginTimes = intval($_SESSION['login_times']);
if (kekezu::submitcheck(isset($formhash)) || isset($login_type) == 3) {
    if ($code) {
        $strCodeCheck = kekezu::check_secode($code);
        if ($strCodeCheck != 1) {
            $tips['errors']['code'] = $strCodeCheck;
            kekezu::show_msg($tips, NULL, NULL, NULL, 'error');
        }
    }
    $strCode = isset($code) ? $code : "";
    $intLoginType = isset($login_type) ? $login_type : "";
    $ckb_cookie = isset($ckb_cookie) ? $ckb_cookie : "";
    if (strtoupper(CHARSET) == 'GBK') {
        $account = kekezu::utftogbk($account);
    }
    $arrUserInfo = $objLogin->user_login($account, $password, $strCode, $intLoginType);
    UserCenter::bindingAccount($arrUserInfo['uid'], $arrUserInfo['username'], $arrOauthInfo);
    $_SESSION[$type . '_oauthInfo'] = null;
    $objLogin->save_user_info($arrUserInfo, $account, $ckb_cookie, $intLoginType, 0, true);
    die;
}