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);
70 defined(
'IL_SOAPMODE') && defined(
'IL_SOAPMODE_NUSOAP') &&
73 $this->error_method = NUSOAP;
75 $this->error_method = PHP5;
82 public function __checkSession($sid)
104 if (!
$GLOBALS[
'DIC'][
'ilAuthSession']->isAuthenticated()) {
110 if (
$ilUser->hasToAcceptTermsOfService()) {
116 if ($this->soap_check) {
118 $this->
__setMessage(
'SOAP is not enabled in ILIAS administration for this client');
120 return ($set->get(
"soap_user_administration") == 1);
135 include_once(
'./Services/Init/classes/class.ilErrorHandling.php');
137 set_error_handler(array(
'ilErrorHandling',
'_ilErrorWriter'), E_ALL);
143 $exploded = explode(
'::', $sid);
145 return is_array($exploded) ? $exploded : array(
'sid' =>
'',
'client' =>
'');
151 $this->message = $a_str;
159 $this->message .= isset($this->message) ?
' ' :
'';
160 $this->message .= $a_str;
165 $this->message_code = $a_code;
170 return $this->message_code;
189 require_once(
"Services/Init/classes/class.ilInitialisation.php");
201 include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
208 #echo $a_message, $a_code; 209 switch ($this->error_method) {
211 return new soap_fault($a_code,
'', $a_message);
213 return new SoapFault($a_code, $a_message);
229 if (!$this->__checkSession($sid)) {
235 $rbacsystem = $DIC[
'rbacsystem'];
236 $rbacreview = $DIC[
'rbacreview'];
238 $rbacadmin = $DIC[
'rbacadmin'];
240 $ilClientIniFile = $DIC[
'ilClientIniFile'];
242 if (!is_object($ilClientIniFile)) {
243 return $this->
__raiseError(
"Client ini is not initialized",
"Server");
247 $auth_mode_names = array();
248 foreach ($auth_modes as $mode) {
252 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
253 include_once
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php';
256 $record_ids = array();
258 foreach ($record_types as $type_info) {
259 $type = $type_info[
'obj_type'];
262 $record_ids [] = $record->getRecordId();
265 $record_ids = array_unique($record_ids);
267 $advmwriter->write();
270 include_once(
"./Services/User/classes/class.ilUserXMLWriter.php");
273 $udfWriter->setObjects(
$users);
277 $client_details[] = array(
"installation_id" => IL_INST_ID,
279 "installation_url" => ILIAS_HTTP_PATH,
280 "installation_description" => $ilClientIniFile->readVariable(
"client",
"description"),
281 "installation_language_default" => $ilClientIniFile->readVariable(
"language",
"default"),
282 "installation_session_expire" => $ilClientIniFile->readVariable(
"session",
"expire"),
283 "installation_php_postmaxsize" => $this->
return_bytes(ini_get(
"post_max_size")),
284 "authentication_methods" => join(
",", $auth_mode_names),
285 "authentication_default_method" => $auth_mode_default,
286 "installation_udf_xml" => $udfWriter ->getXML(),
287 "installation_advmd_xml" => $advmwriter->xmlDumpMem(
false)
292 include_once
'./webservice/soap/classes/class.ilXMLResultSet.php';
296 $xmlResult->addArray($client_details,
true);
299 include_once
'./webservice/soap/classes/class.ilXMLResultSetWriter.php';
301 $xmlResultWriter->start();
302 return $xmlResultWriter->getXML();
312 $last = strtolower($val[strlen($val)-1]);
329 switch ($this->error_method) {
333 return $object instanceof SoapFault;
351 $rbacsystem = $DIC[
'rbacsystem'];
352 if (!is_numeric($ref_id)) {
354 'No valid id given.',
361 'CLIENT_OBJECT_NOT_FOUND' 367 'Object is already trashed.',
368 'CLIENT_OBJECT_DELETED' 373 if ((is_array($expected_type) && !in_array(
$type, $expected_type))
375 (!is_array($expected_type) &&
$type != $expected_type)
377 return $this->
__raiseError(
"Wrong type $type for id. Expected: " . (is_array($expected_type) ? join(
",", $expected_type) : $expected_type),
'CLIENT_OBJECT_WRONG_TYPE');
380 if (!$rbacsystem->checkAccess($permission, $ref_id,
$type)) {
381 return $this->
__raiseError(
'Missing permission $permission for type $type.',
'CLIENT_OBJECT_WRONG_PERMISSION');
393 include_once
"Services/Context/classes/class.ilContext.php";
396 require_once(
"Services/Init/classes/class.ilInitialisation.php");
399 $clientdirs = glob(ILIAS_WEB_DIR .
"/*", GLOB_ONLYDIR);
400 require_once(
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
403 if (is_array($clientdirs)) {
404 foreach ($clientdirs as $clientdir) {
405 if (is_object($clientInfo= $this->
getClientInfo(null, $clientdir))) {
406 $writer->addClient($clientInfo);
412 return $writer->getXML();
417 include_once
"Services/Context/classes/class.ilContext.php";
420 require_once(
"Services/Init/classes/class.ilInitialisation.php");
423 $clientdir = ILIAS_WEB_DIR .
"/" . $clientid;
424 require_once(
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
426 $writer->setExportAdvancedMetaDataDefinitions(
true);
427 $writer->setExportUDFDefinitions(
true);
432 return $this->
__raiseError(
"Client ID $clientid does not exist!",
'Client');
435 return $writer->getXML();
442 $ini_file =
"./" . $client_dir .
"/client.ini.php";
445 require_once(
"./Services/Init/classes/class.ilIniFile.php");
447 $ilClientIniFile =
new ilIniFile($ini_file);
448 $ilClientIniFile->read();
449 if ($ilClientIniFile->ERROR !=
"") {
452 $client_id = $ilClientIniFile->readVariable(
'client',
'name');
453 if ($ilClientIniFile->variableExists(
'client',
'expose')) {
454 $client_expose = $ilClientIniFile->readVariable(
'client',
'expose');
455 if ($client_expose ==
"0") {
461 require_once(
"./Services/Database/classes/class.ilDBWrapperFactory.php");
462 $ilDB = ilDBWrapperFactory::getWrapper(
463 $ilClientIniFile->readVariable(
"db",
"type"),
464 $ilClientIniFile->readVariable(
"db",
"inactive_mysqli")
466 $ilDB->initFromIniFile($ilClientIniFile);
467 if (
$ilDB->connect(
true)) {
469 $DIC[
'ilDB'] =
$ilDB;
471 require_once(
"Services/Administration/classes/class.ilSetting.php");
474 unset($DIC[
"ilSetting"]);
475 $DIC[
"ilSetting"] = $settings;
477 define(
"IL_INST_ID", $settings->get(
"inst_id", 0));
478 $settings->access = $ilClientIniFile->readVariable(
"client",
"access");
479 $settings->description = $ilClientIniFile->readVariable(
"client",
"description");
480 $settings->session = min((
int) ini_get(
"session.gc_maxlifetime"), (
int) $ilClientIniFile->readVariable(
"session",
"expire"));
481 $settings->language = $ilClientIniFile->readVariable(
"language",
"default");
482 $settings->clientid = basename($client_dir);
483 $settings->default_show_users_online = $settings->get(
"show_users_online");
484 $settings->default_hits_per_page = $settings->get(
"hits_per_page");
485 $skin = $ilClientIniFile->readVariable(
"layout",
"skin");
486 $style = $ilClientIniFile->readVariable(
"layout",
"style");
487 $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.
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()
if($_SERVER['argc']< 4) $client
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
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
getClientInfo($init, $client_dir)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.