/** * Logs in user on the Adobe Connect server. * * With SWITCHaai we use this login only to log in the technical user! * * @return string $technical_user_session */ public function login() { global $lng, $ilLog; if (null !== self::$technical_user_session) { return self::$technical_user_session; } $instance = ilAdobeConnectServer::_getInstance(); $params['action'] = 'login'; $params['login'] = $instance->getLogin(); $params['password'] = $instance->getPasswd(); $api_url = self::getApiUrl($params); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, TRUE); $output = curl_exec($ch); $curlHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); //Get the Header part from the output $ResponseHeader = mb_substr($output, 0, $curlHeaderSize); //get the breezeSession preg_match_all('|BREEZESESSION=(.*);|U', $ResponseHeader, $content); self::$technical_user_session = implode(';', $content[1]); return self::$technical_user_session; }
/** * @param $sco_id * @return array */ public function getContentIconAttribute($sco_id) { $session = $this->xmlApi->getBreezeSession(); $icons = array(); if ($session != NULL && $this->xmlApi->login($this->adminLogin, $this->adminPass, $session)) { $icons[] = $this->xmlApi->getContentIconAttribute($sco_id, $this->sco_id, $session); } return $icons; }