function personalLiAction() { $token1 = $this->get("token"); $request = $this->getRequest(); $userModel = new UserModel(); $userModel->logout(); if ('POST' == $request->getMethod()) { $mobile = trim($this->post()->get("mobile")); } $url = Common_Config::SSO_VERIFY_URL; $domainId = Common_Config::UDO_OP_DOMAINID; $token = "tokend86ef2e5-e43b-4077-aafd-f2d3290a9889NHL2GezC"; $secret = Common_Config::UDO_OP_SECRET_SERVER; $sign_raw = $domainId . $token . $secret; $sign = md5($sign_raw); $post_data = array("domainId" => $domainId, "token" => $token, "sign" => $sign); //print_r($post_data); $cl = new Common_Curl(); $array = $cl->request($url, $post_data); $uid = $array['id']; //print_r($uid); //print_r($this->uid); $cookie = new User_Cookie(Common_Config::SITE_DOMAIN, Common_Config::SECURE_KEY, Common_Config::SECURE_SIGN); $cookie->login($uid); //print_r($this->uid); /*print_r($_SESSION['uid']);*/ /*print_r($array);*/ // print_r($array); $entrances = $array['entrances']; //print_r($entrances); $this->displayJsonUdo(Common_Error::ERROR_SUCCESS, $entrances); }
public function verify($token) { $url = Common_Config::SSO_SCHOOL_URL; $domainId = Common_Config::UDO_OP_DOMAINID; $secret = Common_Config::UDO_OP_SECRET_SERVER; $sign_raw = $domainId . $token . $secret; $sign = md5($sign_raw); $post_data = array("domainId" => $domainId, "ssotoken" => $token, "sign" => $sign); $cl = new Common_Curl(); $array = $cl->request($url, $post_data); print_r($array); //判断是否返回失败信息 if ($array['code'] != null && $array['code'] == 0) { return -1; } $uid = $array['id']; $cookie = new User_Cookie(Common_Config::SITE_DOMAIN, Common_Config::SECURE_KEY, Common_Config::SECURE_SIGN); $cookie->settoken($token); $cookie->login($uid); return $array; }