34 include_once
'./webservice/soap/classes/class.ilSoapAuthentication.php';
40 parent::ilSOAPAuthentication();
82 $_GET[
'ticket'] = $a_pt;
91 include_once(
"./Services/Init/classes/class.ilInitialisation.php");
93 $this->init->requireCommonIncludes();
97 if(!$this->getClient())
99 $this->__setMessage(
'No client given');
103 if(!$this->getUsername())
105 $this->__setMessage(
'No username given');
109 if(!$this->__buildDSN())
111 $this->__setMessage(
'Error building dsn/Wrong client Id?');
115 if(!$this->__setSessionSaveHandler())
119 if(!$this->__checkAgreement(
'cas'))
129 if($this->soap_check and !$this->__checkSOAPEnabled())
131 $this->__setMessage(
'SOAP is not enabled in ILIAS administration for this client');
132 $this->__setMessageCode(
'Server');
139 if (!phpCAS::checkAuthentication())
141 $this->__setMessage(
'ilSOAPAuthenticationCAS::authenticate(): No valid CAS authentication.');
145 $this->auth->forceCASAuth();
147 if ($this->getUsername() != $this->auth->getCASUser())
149 $this->__setMessage(
'ilSOAPAuthenticationCAS::authenticate(): SOAP CAS user does not match to ticket user.');
153 include_once(
'./Services/User/classes/class.ilObjUser.php');
155 if ($local_user ==
"")
157 $this->__setMessage(
'ilSOAPAuthenticationCAS::authenticate(): SOAP CAS user authenticated but not existing in ILIAS user database.');
167 $this->auth->start();
169 if(!$this->auth->getAuth())
171 $this->__getAuthStatus();
176 $this->setSid(session_id());
184 if(!$this->getClient())
186 $this->__setMessage(
'No client given');
191 $this->__setMessage(
'No session id given');
195 if(!$this->__buildDSN())
197 $this->__setMessage(
'Error building dsn');
200 if(!$this->__setSessionSaveHandler())
208 if($this->soap_check and !$this->__checkSOAPEnabled())
210 $this->__setMessage(
'SOAP is not enabled in ILIAS administration for this client');
211 $this->__setMessageCode(
'Server');
217 if (!$this->auth->checkCASAuth())
219 $this->__setMessage(
'ilSOAPAuthenticationCAS::authenticate(): No valid CAS authentication.');
222 $this->auth->forceCASAuth();
224 $this->auth->start();
225 if(!$this->auth->getAuth())
227 $this->__setMessage(
'Session not valid');
238 if (!is_object($this->db))
240 include_once
'./classes/class.ilDBx.php';
241 $this->db =&
new ilDBx($this->dsn);
245 $this->init->initSettings();
247 $this->init->buildHTTPPath();
249 $query =
"SELECT * FROM settings WHERE ".
250 " keyword = ".$this->db->quote(
"cas_server").
" OR ".
251 " keyword = ".$this->db->quote(
"cas_port").
" OR ".
252 " keyword = ".$this->db->quote(
"cas_uri");
253 $res = $this->db->query($query);
257 $cas_set[$rec[
"keyword"]] = $rec[
"value"];
260 $auth_params = array(
262 "server_hostname" => $cas_set[
"cas_server"],
263 "server_port" => $cas_set[
"cas_port"],
264 "server_uri" => $cas_set[
"cas_uri"]);
266 include_once(
"Services/CAS/classes/class.ilCASAuth.php");
267 $this->auth =
new ilCASAuth($auth_params);
270 phpCAS::setFixedServiceURL(ILIAS_HTTP_PATH.
"/webservice/soap/server.php");