function get_userinfo($token) { $created = substr_replace(get_date('Y-m-d\\TH:i:sO', UTIME), ':', -2, 0); $api_sig = auth_jugemkey::hmac_sha1($this->sec_key, $this->api_key . $created . $token); $headers = array('X-JUGEMKEY-API-CREATED' => $created, 'X-JUGEMKEY-API-KEY' => $this->api_key, 'X-JUGEMKEY-API-TOKEN' => $token, 'X-JUGEMKEY-API-SIG' => $api_sig); $data = http_request(JUGEMKEY_URL_USER, 'GET', $headers); $rc = array(); $rc['rc'] = $data['rc']; if ($data['rc'] != 200 && $data['rc'] != 401) { return $rc; } $xml_parser = xml_parser_create(); xml_parse_into_struct($xml_parser, $data['data'], $val, $index); xml_parser_free($xml_parser); foreach ($val as $x) { if ($x['type'] != 'complete') { continue; } $rc[strtolower($x['tag'])] = $x['value']; } return $rc; }