public function synlogin($get, $post) { 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"'); $uc_uid = $get['uid']; $uc_uname = uc_auto_charset($get['username']); $uc_password = $get['password']; $uc_user_ref = ts_get_ucenter_user_ref('', $uc_uid); $user = ts_get_user($uc_user_ref['uid']); if ($user) { //检查是否激活,未激活用户不自动登录 if ($user['is_active'] == 0) { exit; } if ($uc_uname != $uc_user_ref['uc_username']) { ts_update_ucenter_user_ref($uc_user_ref['uid'], $uc_uid, $uc_uname); } //登录到TS系统 $user['login_from_dz'] = true; $result = ts_synclogin($user); } }
function uc_user_login($username, $password, $isuid = 0, $checkques = 0, $questionid = '', $answer = '') { $username = ts_auto_charset($username); $answer = ts_auto_charset($answer); $isuid = intval($isuid); $return = call_user_func(UC_API_FUNC, 'user', 'login', array('username' => $username, 'password' => $password, 'isuid' => $isuid, 'checkques' => $checkques, 'questionid' => $questionid, 'answer' => $answer)); $result = UC_CONNECT == 'mysql' ? $return : uc_unserialize($return); $result[1] = uc_auto_charset($result[1]); return $result; }
function updatepw($get, $post) { if (!API_UPDATEPW) { return API_RETURN_FORBIDDEN; } $uc_username = uc_auto_charset($get['username']); $password = $get['password']; $uc_user_ref = ts_get_ucenter_user_ref('', '', $uc_username); M('user')->where("uid={$uc_user_ref['uid']}")->setField('password', md5($password)); return API_RETURN_SUCCEED; }