联系官方销售客服
1835022288
028-61286886
/**
* 站点间的同步退出
*/
protected function api_synlogin() {
$code = dr_authcode(str_replace(' ', '+', $this->input->get('code')));
if (!$code) {
exit('code is null');
}
list($uid, $salt) = explode('-', $code);
if (!$uid || !$salt) {
exit('data is null');
}
$member = $this->db->select('password,salt')->where('uid', $uid)->get('member')->row_array();
if (!$member) {
exit('check error');
} elseif ($member['salt'] != $salt) {
exit('error');
}
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
$expire = max((int)$this->input->get('expire'), 86400);
ob_start();
set_cookie('member_uid', $uid, $expire);
set_cookie('member_cookie', substr(md5(SYS_KEY.$member['password']), 5, 20), $expire);
ob_get_clean();
exit('ok uid='.$uid);
}
/**
* 站点间的同步登录
*/
protected function api_synlogout() {
if ($this->session->userdata('member_auth_uid')) {
$this->session->unset_userdata('member_auth_uid');
} else {
set_cookie('member_uid', 0, -1);
set_cookie('member_cookie', '', -1);
if ($this->uid) {
$this->db->delete('member_online', 'uid='.$this->uid);
}
}
}