https://discuz.dismall.com/thread-2293179-1-1.html
品牌空间 api/uc.php
确实已经存在登录免激活
但是无效。
function synlogin($get, $post) {
global $_G, $_SGLOBAL;
if(!API_SYNLOGIN) {
return API_RETURN_FORBIDDEN;
}
//note 同步登录 API 接口
obclean();
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
$uid = intval($get['uid']);
$cookietime = 2592000;
$ss_auth_key = md5($_G['setting']['sitekey'].$_SERVER['HTTP_USER_AGENT']);
include_once(B_ROOT.'./source/class/db_mysql.class.php');
//链接数据库
dbconnect();
$query = DB::query("SELECT * FROM ".DB::table('members')." WHERE uid='$uid'");
if($member = DB::fetch($query)) {
ssetcookie('sid', '', 86400 * 365);
ssetcookie('cookietime', $cookietime, 31536000);
ssetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime, 1, true);
} else {
if($ucdata = uc_get_user($uid, 1)) {
list($uid, $username, $email) = $ucdata;
$password = md5($uid.'|'.random(8));
$groupid = 2;
$dateline = $_G['timestamp'];
$updatetime = $_G['timestamp'];
$insertsqlarr = array(
'uid' => $uid,
'username' => addslashes($username),
'password' => $password,
'groupid' => $groupid,
'email' => $email,
'dateline' => $dateline,
'updatetime' => $updatetime,
'lastlogin' => $_G['timestamp'],
'ip' => $_G['clientip']
);
inserttable('members', $insertsqlarr);
ssetcookie('sid', '', 86400 * 365);
ssetcookie('cookietime', $cookietime, 31536000);
ssetcookie('auth', authcode("$password\t$uid", 'ENCODE'), $cookietime, 1, true);
} else {
ssetcookie('cookietime', $cookietime, 31536000);
ssetcookie('loginuser', $get['username'], $cookietime);
ssetcookie('activationauth', authcode($get['username'], 'ENCODE'), $cookietime);
}
}
}
|