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);
58 define(
'USER_FOLDER_ID',7);
64 $this->error_method = NUSOAP;
68 $this->error_method = PHP5;
70 #echo ("SOAP: using soap mode ".IL_SOAPMODE == IL_SOAPMODE_NUSOAP ? "NUSOAP": "PHP5");
80 $this->sauth->setClient(
$client);
81 $this->sauth->setSid($sid);
83 if(!$this->sauth->validateSession())
99 include_once(
'classes/class.ilErrorHandling.php');
101 set_error_handler(array(
'ilErrorHandling',
'_ilErrorWriter'),E_ALL);
107 $exploded = explode(
'::',$sid);
109 return is_array($exploded) ? $exploded : array(
'sid' =>
'',
'client' =>
'');
115 $this->message = $a_str;
119 return $this->message;
123 $this->message .= isset($this->message) ?
' ' :
'';
124 $this->message .= $a_str;
133 include_once
'./webservice/soap/classes/class.ilSoapAuthenticationCAS.php';
136 include_once
'./webservice/soap/classes/class.ilSoapAuthenticationLDAP.php';
140 include_once
'./webservice/soap/classes/class.ilSoapAuthentication.php';
148 #echo $a_message, $a_code;
149 switch($this->error_method)
154 return new SoapFault($a_code, $a_message);
168 return $this->
__raiseError($this->sauth->getMessage(),$this->sauth->getMessageCode());
172 include_once
'./include/inc.header.php';
173 global $rbacsystem, $rbacreview,
$ilLog, $rbacadmin,
$ilSetting, $ilClientIniFile;
175 if (!is_object($ilClientIniFile)) {
176 return $this->
__raiseError(
"Client ini is not initialized",
"Server");
181 $auth_mode_names = array();
182 foreach ($auth_modes as $mode) {
186 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
187 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php';
190 $record_ids = array();
192 foreach($record_types as $type) {
194 foreach ($records as $record){
195 $record_ids [] = $record->getRecordId();
198 $record_ids = array_unique($record_ids);
200 $advmwriter->write();
203 include_once (
"./Services/User/classes/class.ilUserXMLWriter.php");
206 $udfWriter->setObjects($users);
210 $client_details[] = array (
"installation_id" => IL_INST_ID,
212 "installation_url" => ILIAS_HTTP_PATH,
213 "installation_description" => $ilClientIniFile->readVariable(
"client",
"description"),
214 "installation_language_default" => $ilClientIniFile->readVariable(
"language",
"default"),
215 "installation_session_expire" => $ilClientIniFile->readVariable(
"session",
"expire"),
216 "installation_php_postmaxsize" => $this->
return_bytes(ini_get(
"post_max_size")),
217 "authentication_methods" => join(
",", $auth_mode_names),
218 "authentication_default_method" => $auth_mode_default,
219 "installation_udf_xml" => $udfWriter ->getXML(),
220 "installation_advmd_xml" => $advmwriter->xmlDumpMem(
false)
225 include_once
'./webservice/soap/classes/class.ilXMLResultSet.php';
229 $xmlResult->addArray($client_details,
true);
232 include_once
'./webservice/soap/classes/class.ilXMLResultSetWriter.php';
234 $xmlResultWriter->start();
235 return $xmlResultWriter->getXML();
244 $last = strtolower($val{strlen($val)-1});
258 switch($this->error_method)
263 return $object instanceof SoapFault;
286 'CLIENT_OBJECT_NOT_FOUND');
290 return $this->
__raiseError(
'Object is already trashed.',
291 'CLIENT_OBJECT_DELETED');
295 if ((is_array($expected_type) && !in_array($type, $expected_type))
297 (!is_array($expected_type) && $type != $expected_type)
300 return $this->
__raiseError(
"Wrong type $type for id. Expected: ".(is_array($expected_type) ? join (
",",$expected_type) : $expected_type),
'CLIENT_OBJECT_WRONG_TYPE');
303 if (!$rbacsystem->checkAccess($permission,
$ref_id, $type))
305 return $this->
__raiseError(
'Missing permission $permission for type $type.',
'CLIENT_OBJECT_WRONG_PERMISSION');
317 require_once(
"Services/Init/classes/class.ilInitialisation.php");
320 $init->requireCommonIncludes();
321 $init->initIliasIniFile();
323 $ilias = &
new ILIAS();
329 require_once (
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
332 if (is_array($clientdirs))
334 foreach ($clientdirs as $clientdir)
336 if (is_object($clientInfo= $this->
getClientInfo($init, $clientdir)))
338 $writer->addClient ($clientInfo);
344 return $writer->getXML();
349 require_once(
"Services/Init/classes/class.ilInitialisation.php");
352 $init->requireCommonIncludes();
353 $init->initIliasIniFile();
355 $ilias = &
new ILIAS();
361 require_once (
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
363 $writer->setExportAdvancedMetaDataDefinitions (
true);
364 $writer->setExportUDFDefinitions (
true);
371 return $this->
__raiseError(
"Client ID $clientid does not exist!",
'Client');
373 return $writer->getXML();
379 $ini_file =
"./".$client_dir.
"/client.ini.php";
382 require_once(
"classes/class.ilIniFile.php");
384 $ilClientIniFile =
new ilIniFile($ini_file);
385 $ilClientIniFile->read();
386 if ($ilClientIniFile->ERROR !=
"")
390 $client_id = $ilClientIniFile->readVariable(
'client',
'name');
391 if ($ilClientIniFile->variableExists(
'client',
'expose'))
393 $client_expose = $ilClientIniFile->readVariable(
'client',
'expose');
394 if ($client_expose ==
"0")
399 $dsn = $ilClientIniFile->readVariable(
"db",
"type").
"://".$ilClientIniFile->readVariable(
"db",
"user").
400 ":".$ilClientIniFile->readVariable(
"db",
"pass").
401 "@".$ilClientIniFile->readVariable(
"db",
"host").
402 "/".$ilClientIniFile->readVariable(
"db",
"name");
405 require_once
"classes/class.ilDBx.php";
406 $ilDB =
new ilDBx($dsn);
409 require_once(
"Services/Administration/classes/class.ilSetting.php");
413 define (
"IL_INST_ID", $settings->get(
"inst_id",0));
414 $settings->access = $ilClientIniFile->readVariable(
"client",
"access");
415 $settings->description = $ilClientIniFile->readVariable(
"client",
"description");
416 $settings->session = min((
int) ini_get(
"session.gc_maxlifetime"), (
int) $ilClientIniFile->readVariable(
"session",
"expire"));
417 $settings->language = $ilClientIniFile->readVariable(
"language",
"default");
418 $settings->clientid = basename($client_dir);
419 $settings->default_show_users_online = $settings->get(
"show_users_online");
420 $settings->default_hits_per_page = $settings->get(
"hits_per_page");
421 $skin = $ilClientIniFile->readVariable(
"layout",
"skin");
422 $style = $ilClientIniFile->readVariable(
"layout",
"style");
423 $settings->default_skin_style = $skin.
":".$style;