function s_action_user($verify = true) { //先从memcache中获取 if (false === ($sso = new SSOCookie('cookie.conf')) || false === ($cookie = $sso->getCookie()) || s_bad_id($cookie['uniqueid'], $uniqueid)) { return false; } if ($verify === false) { return $cookie; } //需要从weibo平台中获取用户信息 return s_user_by_uid($uniqueid); }
function s_user_by_domain($domain) { if (s_bad_string($domain, $domain)) { return false; } $key = "user_by_domain_" . $domain; $params = array("domain" => $domain); if (false === ($data = s_memcache_get($key)) || false === ($user = s_weibo_http("/users/domain_show.json", $params))) { //缓存中不存在 return false; } //获取uid,从缓存中获取用户信息 return s_user_by_uid($uid); }
function s_action_user($update = true) { //先从memcache中获取 if (false === ($sso = new SSOCookie('cookie.conf')) || false === ($cookie = $sso->getCookie()) || s_bad_id($cookie['uniqueid'], $uniqueid)) { return false; } //将cookie中的变量换成标准的uid, uname $cookie['uid'] = $cookie['uniqueid']; $cookie['uname'] = $cookie['screen_name']; if ($update === false) { return $cookie; } //需要从weibo平台中获取用户信息 return s_user_by_uid($uniqueid); }
function s_action_user($update = true, $checkref = true) { //检查referer if ($checkref === true) { if (false === ($ref = s_action_referer())) { //没有来源,有可能是非法请求或者是flash请求 return false; } if (false === ($allows = function_exists('source_list'))) { } } //先从memcache中获取 if (false === ($sso = new SSOCookie('cookie.conf')) || false === ($cookie = $sso->getCookie()) || s_bad_id($cookie['uniqueid'], $uniqueid)) { return false; } //将cookie中的变量换成标准的uid, uname $cookie['uid'] = $cookie['uniqueid']; $cookie['uname'] = $cookie['screen_name']; if ($update === false) { return $cookie; } //需要从weibo平台中获取用户信息 return s_user_by_uid($uniqueid); }
define("APP_NAME", "shframework"); define("APP_WEIBOID", 2680839281); define("APP_DB_PREFIX", "201205shf"); #define("APP_URL", "http://all.vic.sina.com.cn/disney"); #define("APP_TURL", "http://all.vic.sina.com.cn/disney"); if (s_bad_get('type', $type)) { $type = 'getWeiboID'; } if ($type == 'getUserDetail') { //查询用户详情 if (s_bad_post('token', $token)) { return s_action_error('require params: name or uid.'); } if (!s_bad_id($token)) { //是数字,当UID $data = s_user_by_uid($token); } else { if (!s_bad_string($token)) { echo 'null'; //是字符,当username $data = s_user_by_nickname($token); } } } else { if ($type === 'getWeiboDetail') { if (s_bad_post('token', $token)) { return s_action_error('require params: wid.'); } if (!s_bad_id($token)) { //是数字,当WID $data = s_weibo_by_wid($token);