phpcms2008整合discuz1.5+ucenter1.5
?
??
?
?
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']);
?
?? $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
?
?? if($member = DB::fetch($query)) {
?
??? dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
?
?? }else{
?
?????? $username = $get['username'];???????????????????????
?
???????????? $password = md5(time().rand(100000, 999999));
?
???????????? $email = $get['email'];
?
???????????? $ip = $_SERVER['REMOTE_ADDR'];
?
???????????? $time = time();??
?
???????????? $userdata = array(
?
??????? ?????????????????'uid' => $uid,
?
???????????????????????? 'username' => $username,
?
???????????????????????? 'password' => $password,
?
???????????????????????? 'email' => $email,
?
???????????????????????? 'adminid' => 0,
?
???????????????????????? 'groupid' => 10,
?
???????????????????????? 'regdate' => $time,
?
???????????????????????? 'credits' => 0,
?
???????????????????????? 'timeoffset' => 9999
?
???????????? );
?
???????????? DB::insert('common_member', $userdata);
?
???????????? $status_data = array(
?
???? ????????????????????'uid' => $uid,
?
???????????????????????? 'regip' => $ip,
?
???????????????????????? 'lastip' => $ip,
?
???????????????????????? 'lastvisit' => $time,
?
???????????????????????? 'lastactivity' => $time,
?
???????????????????????? 'lastpost' => 0,
?
???????????????????????? 'lastsendmail' => 0,
?
???????????? );
?
???????????? DB::insert('common_member_status', $status_data);
?
???????????? DB::insert('common_member_profile', array('uid' => $uid));
?
???????????? DB::insert('common_member_field_forum', array('uid' => $uid));
?
???????????? DB::insert('common_member_field_home', array('uid' => $uid));
?
???????????? DB::insert('common_member_count', array('uid' => $uid));
?
???????????? $query = DB::query("SELECT uid, username, password FROM ".DB::table('common_member')." WHERE uid='$uid'");
?
???????????? if($member = DB::fetch($query)) {
?
???????????????? dsetcookie('auth', authcode("$member[password]\t$member[uid]", 'ENCODE'), $cookietime);
?
???????????? }
?
?? }
?
?}
?
?list($uc_uid, $uc_username, $uc_password, $uc_email) =? uc_call("uc_user_login", array($memberinfo['username'], $memberinfo['password']));
?
$synlogin_code = uc_call('uc_user_synlogin', array($uc_uid));
?
showmessage('开始填写详细资料!'.$script.$synlogin_code, $M['url'].'register_model.php');
5.??? 更新phpcms,ucenter,discuz的缓存
?