21 $this->email = $a_email;
27 self::URL_DISPLAYER .
"convert/email",
28 array(
"email" => $this->email),
32 if (!isset($json->status) ||
33 $json->status !=
"okay") {
37 $this->uid = $json->userId;
45 self::URL_DISPLAYER . $this->uid .
"/groups.json" 50 foreach ($json->groups as $group) {
51 $result[$group->groupId] = array(
52 "title" => $group->name,
53 "size" => $group->badges
65 self::URL_DISPLAYER . $this->uid .
"/group/" . $a_group_id .
".json" 69 $json->status ==
"missing") {
75 foreach ($json->badges as $raw) {
76 $badge = $raw->assertion->badge;
79 $issued_on = is_numeric($raw->assertion->issued_on)
80 ? $raw->assertion->issued_on
81 : strtotime($raw->assertion->issued_on);
84 "title" => $badge->name,
85 "description" => $badge->description,
86 "image_url" => $badge->image,
87 "criteria_url" => $badge->criteria,
88 "issuer_name" => $badge->issuer->name,
89 "issuer_url" => $badge->issuer->origin,
98 protected function sendRequest($a_url, array $a_param = array(), $a_is_post =
false)
101 include_once
"Services/WebServices/Curl/classes/class.ilCurlConnection.php";
105 $curl->setOpt(CURLOPT_FRESH_CONNECT,
true);
106 $curl->setOpt(CURLOPT_RETURNTRANSFER,
true);
107 $curl->setOpt(CURLOPT_FORBID_REUSE,
true);
108 $curl->setOpt(CURLOPT_HEADER, 0);
109 $curl->setOpt(CURLOPT_CONNECTTIMEOUT, 3);
110 $curl->setOpt(CURLOPT_POSTREDIR, 3);
113 $curl->setOpt(CURLOPT_SSL_VERIFYPEER,
false);
115 $curl->setOpt(CURLOPT_HTTPHEADER, array(
116 "Accept: application/json",
120 if ((
bool) $a_is_post) {
121 $curl->setOpt(CURLOPT_POST, 1);
122 if (
sizeof($a_param)) {
123 $curl->setOpt(CURLOPT_POSTFIELDS, http_build_query($a_param));
126 $curl->setOpt(CURLOPT_HTTPGET, 1);
127 if (
sizeof($a_param)) {
129 (strpos($a_url,
"?") ===
false ?
"?" :
"") .
130 http_build_query($a_param);
133 $curl->setOpt(CURLOPT_URL, $a_url);
135 $answer = $curl->exec();
141 return json_decode($answer);
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
sendRequest($a_url, array $a_param=array(), $a_is_post=false)