35 include_once
'./webservice/soap/lib/nusoap.php';
36 include_once (
"./Services/Authentication/classes/class.ilAuthUtils.php");
38 define (
'SOAP_CLIENT_ERROR', 1);
39 define (
'SOAP_SERVER_ERROR', 2);
61 define(
'USER_FOLDER_ID',7);
67 $this->error_method = NUSOAP;
71 $this->error_method = PHP5;
73 #echo ("SOAP: using soap mode ".IL_SOAPMODE == IL_SOAPMODE_NUSOAP ? "NUSOAP": "PHP5");
78 function __checkSession($sid)
100 if(!$ilAuth->getAuth())
102 switch($ilAuth->getStatus())
126 if($ilUser->hasToAcceptTermsOfService())
133 if($this->soap_check)
136 $this->
__setMessage(
'SOAP is not enabled in ILIAS administration for this client');
138 return ($set->get(
"soap_user_administration") == 1);
153 include_once(
'./Services/Init/classes/class.ilErrorHandling.php');
155 set_error_handler(array(
'ilErrorHandling',
'_ilErrorWriter'),E_ALL);
161 $exploded = explode(
'::',$sid);
163 return is_array($exploded) ? $exploded : array(
'sid' =>
'',
'client' =>
'');
169 $this->message = $a_str;
173 return $this->message;
177 $this->message .= isset($this->message) ?
' ' :
'';
178 $this->message .= $a_str;
183 $this->message_code = $a_code;
188 return $this->message_code;
197 #$_SESSION['_authhttp'.md5(CLIENT_ID)] = true;
198 #$_SESSION['PHPSESSID'] = $sid;
207 require_once(
"Services/Init/classes/class.ilInitialisation.php");
221 include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
228 #echo $a_message, $a_code;
229 switch($this->error_method)
234 return new SoapFault($a_code, $a_message);
250 if(!$this->__checkSession($sid))
255 global $rbacsystem, $rbacreview,
$ilLog, $rbacadmin,
$ilSetting, $ilClientIniFile;
257 if (!is_object($ilClientIniFile)) {
258 return $this->
__raiseError(
"Client ini is not initialized",
"Server");
263 $auth_mode_names = array();
264 foreach ($auth_modes as $mode) {
268 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
269 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php';
272 $record_ids = array();
274 foreach($record_types as $type) {
277 $record_ids [] = $record->getRecordId();
280 $record_ids = array_unique($record_ids);
282 $advmwriter->write();
285 include_once (
"./Services/User/classes/class.ilUserXMLWriter.php");
288 $udfWriter->setObjects($users);
292 $client_details[] = array (
"installation_id" => IL_INST_ID,
294 "installation_url" => ILIAS_HTTP_PATH,
295 "installation_description" => $ilClientIniFile->readVariable(
"client",
"description"),
296 "installation_language_default" => $ilClientIniFile->readVariable(
"language",
"default"),
297 "installation_session_expire" => $ilClientIniFile->readVariable(
"session",
"expire"),
298 "installation_php_postmaxsize" => $this->
return_bytes(ini_get(
"post_max_size")),
299 "authentication_methods" => join(
",", $auth_mode_names),
300 "authentication_default_method" => $auth_mode_default,
301 "installation_udf_xml" => $udfWriter ->getXML(),
302 "installation_advmd_xml" => $advmwriter->xmlDumpMem(
false)
307 include_once
'./webservice/soap/classes/class.ilXMLResultSet.php';
311 $xmlResult->addArray($client_details,
true);
314 include_once
'./webservice/soap/classes/class.ilXMLResultSetWriter.php';
316 $xmlResultWriter->start();
317 return $xmlResultWriter->getXML();
326 $last = strtolower($val{strlen($val)-1});
340 switch($this->error_method)
345 return $object instanceof SoapFault;
368 'CLIENT_OBJECT_NOT_FOUND');
372 return $this->
__raiseError(
'Object is already trashed.',
373 'CLIENT_OBJECT_DELETED');
377 if ((is_array($expected_type) && !in_array($type, $expected_type))
379 (!is_array($expected_type) && $type != $expected_type)
382 return $this->
__raiseError(
"Wrong type $type for id. Expected: ".(is_array($expected_type) ? join (
",",$expected_type) : $expected_type),
'CLIENT_OBJECT_WRONG_TYPE');
385 if (!$rbacsystem->checkAccess($permission,
$ref_id, $type))
387 return $this->
__raiseError(
'Missing permission $permission for type $type.',
'CLIENT_OBJECT_WRONG_PERMISSION');
399 include_once
"Services/Context/classes/class.ilContext.php";
402 require_once(
"Services/Init/classes/class.ilInitialisation.php");
406 require_once (
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
409 if (is_array($clientdirs))
411 foreach ($clientdirs as $clientdir)
413 if (is_object($clientInfo= $this->
getClientInfo($init, $clientdir)))
415 $writer->addClient ($clientInfo);
421 return $writer->getXML();
426 include_once
"Services/Context/classes/class.ilContext.php";
429 require_once(
"Services/Init/classes/class.ilInitialisation.php");
433 require_once (
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
435 $writer->setExportAdvancedMetaDataDefinitions (
true);
436 $writer->setExportUDFDefinitions (
true);
443 return $this->
__raiseError(
"Client ID $clientid does not exist!",
'Client');
445 return $writer->getXML();
451 $ini_file =
"./".$client_dir.
"/client.ini.php";
454 require_once(
"./Services/Init/classes/class.ilIniFile.php");
456 $ilClientIniFile =
new ilIniFile($ini_file);
457 $ilClientIniFile->read();
458 if ($ilClientIniFile->ERROR !=
"")
462 $client_id = $ilClientIniFile->readVariable(
'client',
'name');
463 if ($ilClientIniFile->variableExists(
'client',
'expose'))
465 $client_expose = $ilClientIniFile->readVariable(
'client',
'expose');
466 if ($client_expose ==
"0")
471 require_once(
"./Services/Database/classes/class.ilDBWrapperFactory.php");
473 $ilClientIniFile->readVariable(
"db",
"inactive_mysqli"));
474 $ilDB->initFromIniFile($ilClientIniFile);
475 if ($ilDB->connect(
true))
479 require_once(
"Services/Administration/classes/class.ilSetting.php");
483 define (
"IL_INST_ID", $settings->get(
"inst_id",0));
484 $settings->access = $ilClientIniFile->readVariable(
"client",
"access");
485 $settings->description = $ilClientIniFile->readVariable(
"client",
"description");
486 $settings->session = min((
int) ini_get(
"session.gc_maxlifetime"), (
int) $ilClientIniFile->readVariable(
"session",
"expire"));
487 $settings->language = $ilClientIniFile->readVariable(
"language",
"default");
488 $settings->clientid = basename($client_dir);
489 $settings->default_show_users_online = $settings->get(
"show_users_online");
490 $settings->default_hits_per_page = $settings->get(
"hits_per_page");
491 $skin = $ilClientIniFile->readVariable(
"layout",
"skin");
492 $style = $ilClientIniFile->readVariable(
"layout",
"style");
493 $settings->default_skin_style = $skin.
":".$style;