刚刚自己改了下api/uc.php文件,测试通过。
- function synlogin($get, $post) {
- global $_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"');
-
- $cookietime = 31536000;
- $uid = intval($get['uid']);
- $query = $_SGLOBAL['db']->query("SELECT uid, username, password FROM ".tname('member')." WHERE uid='$uid'");
- /////////////////////////edit ---------------
- if(!$member = $_SGLOBAL['db']->fetch_array($query)) {
- $member = array(
- 'uid' => $uid,
- 'username' => addslashes($get['username']),
- 'password' => md5("$uid|$_SGLOBAL[timestamp]")//本地密码随机生成
- );
- inserttable('member', $member, 0, true);
- }
- include_once S_ROOT.'./source/function_space.php';
- $member = saddslashes($member);
- $space = insertsession($member);
- ///////////////////////////end--------------
- //设置cookie
- ssetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
- ssetcookie('loginuser', $get['username'], $cookietime);
- }
复制代码 |