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);
65 define(
'USER_FOLDER_ID', 7);
73 $this->error_method = NUSOAP;
75 $this->error_method = PHP5;
82 public function __checkSession($sid)
102 if (!
$GLOBALS[
'DIC'][
'ilAuthSession']->isAuthenticated()) {
108 if ($ilUser->hasToAcceptTermsOfService()) {
114 if ($this->soap_check) {
116 $this->
__setMessage(
'SOAP is not enabled in ILIAS administration for this client');
118 return ($set->get(
"soap_user_administration") == 1);
133 include_once(
'./Services/Init/classes/class.ilErrorHandling.php');
135 set_error_handler(
array(
'ilErrorHandling',
'_ilErrorWriter'), E_ALL);
141 $exploded = explode(
'::', $sid);
143 return is_array($exploded) ? $exploded :
array(
'sid' =>
'',
'client' =>
'');
149 $this->message = $a_str;
157 $this->message .= isset($this->message) ?
' ' :
'';
158 $this->message .= $a_str;
163 $this->message_code = $a_code;
168 return $this->message_code;
187 require_once(
"Services/Init/classes/class.ilInitialisation.php");
199 include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
206 #echo $a_message, $a_code; 207 switch ($this->error_method) {
209 return new soap_fault($a_code,
'', $a_message);
211 return new SoapFault($a_code, $a_message);
227 if (!$this->__checkSession($sid)) {
231 global $rbacsystem, $rbacreview,
$ilLog, $rbacadmin,
$ilSetting, $ilClientIniFile;
233 if (!is_object($ilClientIniFile)) {
234 return $this->
__raiseError(
"Client ini is not initialized",
"Server");
238 $auth_mode_names =
array();
239 foreach ($auth_modes as $mode) {
243 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
244 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php';
247 $record_ids =
array();
249 foreach ($record_types as $type_info) {
250 $type = $type_info[
'obj_type'];
253 $record_ids [] = $record->getRecordId();
256 $record_ids = array_unique($record_ids);
258 $advmwriter->write();
261 include_once(
"./Services/User/classes/class.ilUserXMLWriter.php");
264 $udfWriter->setObjects(
$users);
268 $client_details[] =
array(
"installation_id" => IL_INST_ID,
270 "installation_url" => ILIAS_HTTP_PATH,
271 "installation_description" => $ilClientIniFile->readVariable(
"client",
"description"),
272 "installation_language_default" => $ilClientIniFile->readVariable(
"language",
"default"),
273 "installation_session_expire" => $ilClientIniFile->readVariable(
"session",
"expire"),
274 "installation_php_postmaxsize" => $this->
return_bytes(ini_get(
"post_max_size")),
275 "authentication_methods" => join(
",", $auth_mode_names),
276 "authentication_default_method" => $auth_mode_default,
277 "installation_udf_xml" => $udfWriter ->getXML(),
278 "installation_advmd_xml" => $advmwriter->xmlDumpMem(
false)
283 include_once
'./webservice/soap/classes/class.ilXMLResultSet.php';
287 $xmlResult->addArray($client_details,
true);
290 include_once
'./webservice/soap/classes/class.ilXMLResultSetWriter.php';
292 $xmlResultWriter->start();
293 return $xmlResultWriter->getXML();
303 $last = strtolower($val{strlen($val)-1});
320 switch ($this->error_method) {
324 return $object instanceof SoapFault;
341 if (!is_numeric($ref_id)) {
343 'No valid id given.',
350 'CLIENT_OBJECT_NOT_FOUND' 356 'Object is already trashed.',
357 'CLIENT_OBJECT_DELETED' 362 if ((is_array($expected_type) && !in_array(
$type, $expected_type))
364 (!is_array($expected_type) &&
$type != $expected_type)
366 return $this->
__raiseError(
"Wrong type $type for id. Expected: " . (is_array($expected_type) ? join(
",", $expected_type) : $expected_type),
'CLIENT_OBJECT_WRONG_TYPE');
369 if (!$rbacsystem->checkAccess($permission, $ref_id,
$type)) {
370 return $this->
__raiseError(
'Missing permission $permission for type $type.',
'CLIENT_OBJECT_WRONG_PERMISSION');
382 include_once
"Services/Context/classes/class.ilContext.php";
385 require_once(
"Services/Init/classes/class.ilInitialisation.php");
388 $clientdirs = glob(ILIAS_WEB_DIR .
"/*", GLOB_ONLYDIR);
389 require_once(
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
392 if (is_array($clientdirs)) {
393 foreach ($clientdirs as $clientdir) {
394 if (is_object($clientInfo= $this->
getClientInfo(null, $clientdir))) {
395 $writer->addClient($clientInfo);
401 return $writer->getXML();
406 include_once
"Services/Context/classes/class.ilContext.php";
409 require_once(
"Services/Init/classes/class.ilInitialisation.php");
412 $clientdir = ILIAS_WEB_DIR .
"/" . $clientid;
413 require_once(
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
415 $writer->setExportAdvancedMetaDataDefinitions(
true);
416 $writer->setExportUDFDefinitions(
true);
421 return $this->
__raiseError(
"Client ID $clientid does not exist!",
'Client');
424 return $writer->getXML();
431 $ini_file =
"./" . $client_dir .
"/client.ini.php";
434 require_once(
"./Services/Init/classes/class.ilIniFile.php");
436 $ilClientIniFile =
new ilIniFile($ini_file);
437 $ilClientIniFile->read();
438 if ($ilClientIniFile->ERROR !=
"") {
441 $client_id = $ilClientIniFile->readVariable(
'client',
'name');
442 if ($ilClientIniFile->variableExists(
'client',
'expose')) {
443 $client_expose = $ilClientIniFile->readVariable(
'client',
'expose');
444 if ($client_expose ==
"0") {
450 require_once(
"./Services/Database/classes/class.ilDBWrapperFactory.php");
451 $ilDB = ilDBWrapperFactory::getWrapper(
452 $ilClientIniFile->readVariable(
"db",
"type"),
453 $ilClientIniFile->readVariable(
"db",
"inactive_mysqli")
455 $ilDB->initFromIniFile($ilClientIniFile);
456 if (
$ilDB->connect(
true)) {
458 $DIC[
'ilDB'] =
$ilDB;
460 require_once(
"Services/Administration/classes/class.ilSetting.php");
463 unset($DIC[
"ilSetting"]);
464 $DIC[
"ilSetting"] = $settings;
466 define(
"IL_INST_ID", $settings->get(
"inst_id", 0));
467 $settings->access = $ilClientIniFile->readVariable(
"client",
"access");
468 $settings->description = $ilClientIniFile->readVariable(
"client",
"description");
469 $settings->session = min((
int) ini_get(
"session.gc_maxlifetime"), (
int) $ilClientIniFile->readVariable(
"session",
"expire"));
470 $settings->language = $ilClientIniFile->readVariable(
"language",
"default");
471 $settings->clientid = basename($client_dir);
472 $settings->default_show_users_online = $settings->get(
"show_users_online");
473 $settings->default_hits_per_page = $settings->get(
"hits_per_page");
474 $skin = $ilClientIniFile->readVariable(
"layout",
"skin");
475 $style = $ilClientIniFile->readVariable(
"layout",
"style");
476 $settings->default_skin_style = $skin .
":" .
$style;
XML Writer for XMLResultSet.
checkObjectAccess($ref_id, $expected_type, $permission, $returnObject=false)
check access for ref id: expected type, permission, return object instance if returnobject is true ...
getNIC($sid)
get client information from current as xml result set
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
initErrorWriter()
Overwrite error handler.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
soap_fault class, allows for creation of faults mainly used for returning faults from deployed functi...
static _isInTrash($a_ref_id)
checks wether object is in trash
getClientInfoXML($clientid)
__setMessageCode($a_code)
__initAuthenticationObject($a_auth_mode=AUTH_LOCAL)
static _getActiveAuthModes()
static _getAuthModeName($a_auth_key)
__construct($use_nusoap=true)
Constructor.
static initILIAS()
ilias initialisation
catch(Exception $e) $message
__raiseError($a_message, $a_code)
static setContext($a_context)
set context
static getTypeByRefId($a_ref_id, $stop_on_error=true)
get object type by reference id
const CONTEXT_SOAP_WITHOUT_CLIENT
Create styles array
The data for the language used.
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $a_only_optional=false)
Get activated records by object type.
static init($a_type)
Init context by type.
static _getAssignableObjectTypes($a_include_text=false)
Get assignable object type.
initAuth($sid)
Init authentication.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static getType()
Get context type.
static return_bytes($val)
calculate bytes from K,M,G modifiers e.g: 8M = 8 * 1024 * 1024 bytes
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
getClientInfo($init, $client_dir)