![](https://vkceyugu.cdn.bspapp.com/VKCEYUGU-d9e50375-e13b-49a8-b5ae-8bb85cb78469/545667f3-4c7d-4cb2-bee3-534e16d4ccd0.png)
利用主站校验,跳转回来
<?php$action = param(1);if($action == 'login') {
$_SESSION['referer'] = http_referer();
// 发起的 token
$token = xn_encrypt($time."\t".$useragent);
$s = xn_decrypt($token);
$return_url = xn_urlencode(http_url_path().url('user-synlogin'));
http_location(BBS_URL."user-synlogin.htm?token=$token&return_url=$return_url");
// 接受跳转回来的 token} elseif($action == 'synlogin') {
$token = param('token');
$s = xn_decrypt($token);
$arr = xn_json_decode($s);
empty($arr) AND message(-1, 'TOKEN 有错误');
$_SESSION['uid'] = $arr['uid'];
$_SESSION['user'] = $arr;
$referer = $_SESSION['referer'];
unset($_SESSION['referer']);
message(-1, jump('登陆成功', $referer, 2));
} elseif($action == 'create') {
http_location(BBS_URL.url("user-create"));
} elseif($action == 'logout') {
$uid = 0;
unset($_SESSION['uid']);
unset($_SESSION['user']);
message(-1, jump('退出成功', http_referer(), 2));
}?>
内容看完了
© 版权声明
请登录后发表评论
注册