function login($call_back, $url)
 {
     global $oauth_verifier, $code, $_K;
     if (isset($code) && $this->_wb_type == 'sina') {
         $oauth_verifier = array('code' => $code, 'redirect_uri' => $url);
     }
     if ($call_back) {
         if (isset($code) && $this->_wb_type == 'sina') {
             if ($oauth_verifier) {
                 oauth_api_factory::create_access_token($oauth_verifier, $this->_wb_type, $this->_app_id, $this->_app_secret);
                 $oauth_user_info = $this->get_login_user_info();
                 $bind_info = keke_register_class::is_oauth_bind($this->_wb_type, $oauth_user_info['account']);
                 if ($oauth_user_info && $bind_info) {
                     $user_info = kekezu::get_user_info($bind_info['uid']);
                     $login_obj = new keke_user_login_class();
                     $login_user_info = $login_obj->user_login($user_info['username'], $user_info['password'], null, 1);
                     $login_obj->save_user_info($login_user_info, 1);
                 } else {
                     $_SESSION['wb_type'] = $this->_wb_type;
                     header("Location:{$_K['siteurl']}/index.php?do=index");
                     die;
                 }
             } else {
                 header("Location:{$_K['siteurl']}/index.php?do=login");
                 die;
             }
         } else {
             oauth_api_factory::create_access_token($oauth_verifier, $this->_wb_type, $this->_app_id, $this->_app_secret);
             $oauth_user_info = $this->get_login_user_info();
             $bind_info = keke_register_class::is_oauth_bind($this->_wb_type, $oauth_user_info['account']);
             if ($oauth_user_info && $bind_info) {
                 $user_info = kekezu::get_user_info($bind_info['uid']);
                 $login_obj = new keke_user_login_class();
                 $login_user_info = $login_obj->user_login($user_info['username'], $user_info['password'], null, 1);
                 $login_obj->save_user_info($login_user_info, 1);
             } else {
                 $_SESSION['wb_type'] = $this->_wb_type;
                 header("Location:{$_K['siteurl']}/index.php?do=index");
                 die;
             }
         }
     }
     $this->_url = $url;
     if (oauth_api_factory::get_access_token($this->_wb_type, $this->_app_id, $this->_app_secret)) {
         return true;
     } else {
         $aurl = oauth_api_factory::get_auth_url("{$url}&call_back=1", $this->_wb_type, $this->_app_id, $this->_app_secret);
         header('Location:' . $aurl);
         die;
     }
 }
Exemple #2
0
    $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;
}
Exemple #3
0
$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');
        }
    }
    isset($hdn_refer) and $_K['refer'] = $hdn_refer;
    isset($_COOKIE['kekeloginrefer']) and $_K['refer'] = $_COOKIE['kekeloginrefer'];
    $refer_do = array('do' => null);
    $refer = parse_url($_K['refer']);
    isset($refer['query']) and parse_str($refer['query'], $refer_do);
    !$refer_do['do'] && ($do = 'logout') and $refer_do['do'] = 'logout';
    in_array($refer_do['do'], array('logout', 'register', 'login', 'activating')) and $_K['refer'] = 'index.php' or $_K['refer'] = $_K['refer'];
    $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);
    }
    $account = kekezu::escape($account);
    $objLogin = new keke_user_login_class();
    $arrUserInfo = $objLogin->user_login($account, kekezu::escape($password), $strCode, $intLogin_type);
    db_factory::execute("update " . TABLEPRE . "witkey_space set is_mail=0 where uid=" . $arrUserInfo[uid]);
    $objLogin->save_user_info($arrUserInfo, $account, $ckb_cookie, $intLoginType, intval($autoLogin));
    die;
}
$_SESSION['spread'] = 'index.php?do=login';