CLASS_SSO::sso_sync_login PHP Method

sso_sync_login() public method

同步登录 sso_sync_login function.
public sso_sync_login ( mixed $num_userId ) : void
$num_userId mixed
return void
    function sso_sync_login($num_userId)
    {
        $_arr_sso = array("act_post" => "login", "user_id" => $num_userId);
        $_arr_ssoData = array_merge($this->arr_data, $_arr_sso);
        $_arr_ssoData["signature"] = $this->sso_signature($_arr_ssoData);
        $_arr_get = fn_http(BG_SSO_URL . "?mod=sync", $_arr_ssoData, "post");
        //提交
        $_arr_result = $this->result_process($_arr_get);
        if (isset($_arr_result["urlRows"]) && is_array($_arr_result["urlRows"])) {
            foreach ($_arr_result["urlRows"] as $_key => $_value) {
                $_arr_result["urlRows"][$_key] = fn_htmlcode(urldecode($_value), "decode", "url");
            }
        }
        return $_arr_result;
    }

Usage Example

Example #1
0
//SSO 地址
define(BG_SSO_APPID, 1);
//APP ID
define(BG_SSO_APPKEY, "");
//APP KEY
include_once "func.php";
include_once "notify.class.php";
include_once "sso.class.php";
include_once "sync.class.php";
$obj_sso = new CLASS_SSO();
$str_userName = fn_post("user_name");
$str_userPass = fn_post("user_pass");
$arr_userSso = $obj_sso->sso_login($str_userName, $str_userPass);
//调用登录方法
/* 开始会话等操作  */
$sync = $obj_sso->sso_sync_login();
//调用同步方法
?>
<!DOCTYPE html>
<html lang="zh">
<head>

    <meta charset="utf-8">
    <title>login</title>

    <!--jQuery 库-->
    <script src="jquery.min.js" type="text/javascript"></script>

</head>
<body>