api/uc.php
添加代码
function synlogin($get, $post) {
global $_G;
if(!API_SYNLOGIN) {
return API_RETURN_FORBIDDEN;
}
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']);
if(($member = getuserbyuid($uid, 1))) {
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
}
/**以下代码是新添加**/
else{
$init_arr = explode(',', $_G['setting']['initcredits']);
$groupid = $_G['setting']['regverify'] ? 8 : $_G['setting']['newusergroupid'];
C::t('common_member')->insert($uid, $get['username'], md5(random(10)), $get['email'], $_G['clientip'], $groupid, $init_arr);
C::t('common_member_status')->update($uid, array('lastip' => $_G['clientip'], 'lastvisit' =>TIMESTAMP, 'lastactivity' => TIMESTAMP));
if(($member = getuserbyuid($uid, 1))) {
dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
}
}
/**到这里新增代码结束**/
}