コード例 #1
0
ファイル: UserCenter.php プロジェクト: huangbinzd/kppwGit
 public static function bindingAccount($uid, $username, $arrSaveinfo)
 {
     $returnValue = FALSE;
     $strSql = "select count(id) from " . TABLEPRE . "witkey_member_oauth\n\t\t\t\twhere source ='" . $arrSaveinfo['type'] . "' and oauth_id='{$arrSaveinfo['account']}' and uid=" . $uid;
     $isBind = db_factory::get_count($strSql);
     if (!$isBind) {
         $objMemberOauth = new Keke_witkey_member_oauth_class();
         $objMemberOauth->setAccount($arrSaveinfo['nickname']);
         $objMemberOauth->setOauth_id($arrSaveinfo['account']);
         $objMemberOauth->setSource($arrSaveinfo['type']);
         $objMemberOauth->setUid($uid);
         $objMemberOauth->setUsername($username);
         $objMemberOauth->setOn_time(time());
         $intRes = $objMemberOauth->create_keke_witkey_member_oauth();
         unset($objMemberOauth);
         $intRes and $returnValue = TRUE or $returnValue = FALSE;
     }
     return $returnValue;
 }
コード例 #2
0
ファイル: oauthlogin.php プロジェクト: pengfeiaaa/web
    $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, 1);
    db_factory::execute("delete from " . TABLEPRE . "witkey_space where uid =" . intval($arrBindInfo['uid']));
    db_factory::execute("delete from " . TABLEPRE . "witkey_shop where uid=" . intval($arrBindInfo['uid']));
    db_factory::execute("delete from " . TABLEPRE . "witkey_member where uid=" . intval($arrBindInfo['uid']));
    $objMemberOauth = new Keke_witkey_member_oauth_class();
    $objMemberOauth->setWhere(array('oauth_id' => $arrBindInfo['oauth_id'], 'uid' => $arrBindInfo[uid]));
    $objMemberOauth->setUid($arrUserInfo[uid]);
    $objMemberOauth->setUsername($arrUserInfo[username]);
    $objMemberOauth->edit_keke_witkey_member_oauth();
    $_SESSION[$type . '_oauthInfo'] = null;
    $objLogin->save_user_info($arrUserInfo, $account, $ckb_cookie, $intLoginType, 0, true);
    die;
}
コード例 #3
0
 public static function register_binding($oauth_user_info, $user_info, $type)
 {
     global $_lang, $nick, $taobao_user_id;
     $csql = "select count(*) as c from %switkey_member_oauth where source='%s' and oauth_id ='%s'";
     $c = db_factory::get_one(sprintf($csql, TABLEPRE, $type, $oauth_user_info['account']));
     if (intval($c['c']) == 0) {
         $oauth_obj = new Keke_witkey_member_oauth_class();
         if (!$oauth_user_info['name']) {
             $oauth_user_info['name'] = $nick;
         }
         if (!$oauth_user_info['account']) {
             $oauth_user_info['account'] = $taobao_user_id;
         }
         $oauth_obj->setAccount($oauth_user_info['name']);
         $oauth_obj->setOauth_id($oauth_user_info['account']);
         $oauth_obj->setSource($type);
         $oauth_obj->setUid($user_info['uid']);
         $oauth_obj->setUsername($user_info['username']);
         $oauth_obj->setOn_time(time());
         $oauth_obj->create_keke_witkey_member_oauth() or $this->show_msg($_lang['bind_fail'], 2);
     } else {
         $this->show_msg($_lang['this_user_has_bind'], 7);
     }
     return true;
 }
コード例 #4
0
                    header("Location:" . $request);
                    break;
                case false:
                    if (in_array($type, array('sina', 'qq', 'taobao', 'renren', 'douban', 'baidu'))) {
                        $oauth_obj = OAuthClass::factory($type);
                        $oauth_obj->requestAuthorize();
                    } else {
                        exit('type参数错误');
                    }
                    break;
            }
        }
        break;
    case 'unbind':
        if (abs(intval($id))) {
            switch ($type == "alipay_trust") {
                case true:
                    $interface = "cancel_bind";
                    require S_ROOT . "/payment/alipay_trust/order.php";
                    header("Location:" . $request);
                    break;
                case false:
                    $objMemberOauth = new Keke_witkey_member_oauth_class();
                    $objMemberOauth->setId($id);
                    $objMemberOauth->del_keke_witkey_member_oauth();
                    kekezu::show_msg('解绑成功', $strUrl, null, null, 'ok');
                    break;
            }
        }
        break;
}