public function ssologin() { $auth = mod_login::instance(); if ($auth->is_login()) { $this->frame(); } $sign = $_GET['sign']; if (!$sign) { header("Location: http://fladminsso.feiliu.com/?source=" . rawurlencode(BASE_URL . '?c=login&a=ssologin')); } $ret = ffile_get_contents("http://fladminsso.feiliu.com/client/check/{$sign}"); $retinfo = json_decode($ret, 1); if ($retinfo['code'] == 0) { $retuinfo = $retinfo['userinfo']; $userdata['username'] = $retuinfo['login_name']; $userdata['password'] = $retuinfo['password']; if ($auth->authenticate($userdata, 'sso')) { mod_member::loginhistory(USERNAME); header("Location: " . BASE_URL); exit; } } else { header("Location: http://fladminsso.feiliu.com/?source=" . rawurlencode(BASE_URL . '?c=login&a=ssologin')); exit; } }
function get_weather() { $ret = ffile_get_contents('http://m.weather.com.cn/data/101010100.html'); $wdata = json_decode($ret, 1); $wdata = $wdata['weatherinfo']; $w = array(); $w['today'] = array('t' => $wdata['temp1'], 'text' => $wdata['weather1'], 'wind' => $wdata['wind1'], 'wg' => $wdata['fl1']); $w['next'] = array('t' => $wdata['temp2'], 'text' => $wdata['weather2'], 'wind' => $wdata['wind2'], 'wg' => $wdata['fl2']); return $w; }