19 declare(strict_types=1);
27 include_once
'./webservice/soap/lib/nusoap.php';
28 include_once(
"./Services/Authentication/classes/class.ilAuthUtils.php");
47 defined(
'IL_SOAPMODE') &&
48 defined(
'IL_SOAPMODE_NUSOAP') &&
51 $this->error_method = self::NUSOAP;
53 $this->error_method = self::PHP5;
78 if (!
$GLOBALS[
'DIC'][
'ilAuthSession']->isAuthenticated()) {
84 if (
$ilUser->hasToAcceptTermsOfService()) {
85 $this->
setMessage(
'User agreement no accepted.');
90 if ($this->soap_check) {
92 $this->
setMessage(
'SOAP is not enabled in ILIAS administration for this client');
94 return ((
int) $set->get(
"soap_user_administration",
'0')) === 1;
102 $exploded = explode(
'::', $sid);
104 return is_array($exploded) ? $exploded : array(
'sid' =>
'',
'client' =>
'');
109 $this->message = $a_str;
119 $this->message .= isset($this->message) ?
' ' :
'';
120 $this->message .= $a_str;
125 $this->message_code = $a_code;
139 if (session_status() === PHP_SESSION_ACTIVE && $sid === session_id()) {
143 if (session_status() === PHP_SESSION_ACTIVE) {
154 require_once(
"Services/Init/classes/class.ilInitialisation.php");
165 require_once(
"Services/Init/classes/class.ilInitialisation.php");
174 include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
185 switch ($this->error_method) {
187 return new soap_fault($a_code,
'', $a_message);
189 return new SoapFault($a_code, $a_message);
196 switch ($this->error_method) {
210 array $expected_type,
212 bool $returnObject =
false 216 $rbacsystem = $DIC->rbac()->system();
221 'CLIENT_OBJECT_NOT_FOUND' 227 'Object is already trashed.',
228 'CLIENT_OBJECT_DELETED' 233 if (!in_array(
$type, $expected_type,
true)) {
235 "Wrong type $type for id. Expected: " . implode(
",", $expected_type),
236 'CLIENT_OBJECT_WRONG_TYPE' 239 if (!$rbacsystem->checkAccess($permission, $ref_id,
$type)) {
241 'Missing permission $permission for type $type.',
242 'CLIENT_OBJECT_WRONG_PERMISSION' 249 return $this->
raiseError(
'No valid ref_id given',
'Client');
258 if (!defined(
"ILIAS_WEB_DIR")) {
259 define(
'ILIAS_WEB_DIR', dirname(__DIR__, 3) .
"/data/");
263 require_once(
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
266 if (is_array($clientdirs)) {
267 foreach ($clientdirs as $clientdir) {
268 $writer->addClient($clientdir);
272 return $writer->getXML();
281 if (!defined(
"ILIAS_WEB_DIR")) {
282 define(
'ILIAS_WEB_DIR', dirname(__DIR__, 3) .
"/data/");
286 require_once(
"webservice/soap/classes/class.ilSoapInstallationInfoXMLWriter.php");
289 if (!$writer->addClient($clientdir)) {
291 'Client ID ' . $clientid .
'does not exist!',
296 return $writer->getXML();
appendMessage(string $a_str)
setMessageCode(string $a_code)
raiseError(string $a_message, $a_code)
int $error_method
Defines type of error handling (PHP5 || NUSOAP)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
const CONTEXT_SOAP
SOAP based authentication.
__construct(bool $use_nusoap=true)
checkSession(string $sid)
static _isInTrash(int $ref_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
checkObjectAccess(int $ref_id, array $expected_type, string $permission, bool $returnObject=false)
check access for ref id: expected type, permission, return object instance if returnobject is true ...
static setContext(int $a_context)
set context
setMessage(string $a_str)
initAuthenticationObject()
static getType()
Get context type.
static _lookupType(int $id, bool $reference=false)
getClientInfoXML(string $clientid)