ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilNusoapUserAdministrationAdapter.php
Go to the documentation of this file.
1 <?php
24 require_once('./libs/composer/vendor/autoload.php');
25 
38 
39 include_once './webservice/soap/lib/nusoap.php';
40 include_once './webservice/soap/include/inc.soap_functions.php';
41 require_once('./Services/WebServices/SOAP/classes/class.ilSoapHook.php');
42 require_once('./Services/Init/classes/class.ilInitialisation.php');
43 
45 {
47 
48  public function __construct(bool $a_use_wsdl = true)
49  {
50  define('SERVICE_NAME', 'ILIASSoapWebservice');
51  define('SERVICE_NAMESPACE', 'urn:ilUserAdministration');
52  define('SERVICE_STYLE', 'rpc');
53  define('SERVICE_USE', 'encoded');
54  $this->server = new soap_server();
55  $this->server->decode_utf8 = false;
56  $this->server->class = "ilSoapFunctions";
57 
58  if ($a_use_wsdl) {
59  $this->enableWSDL();
60  }
61 
62  $this->registerMethods();
63  }
64 
65  public function start(): void
66  {
67  $postdata = file_get_contents("php://input");
68  $this->server->service($postdata);
69  exit();
70  }
71 
72  private function enableWSDL(): void
73  {
74  $this->server->configureWSDL(SERVICE_NAME, SERVICE_NAMESPACE);
75  }
76 
77  private function registerMethods(): void
78  {
79  // Add useful complex types. E.g. array("a","b") or array(1,2)
80  $this->server->wsdl->addComplexType(
81  'intArray',
82  'complexType',
83  'array',
84  '',
85  'SOAP-ENC:Array',
86  array(),
87  array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:int[]')),
88  'xsd:int'
89  );
90 
91  $this->server->wsdl->addComplexType(
92  'stringArray',
93  'complexType',
94  'array',
95  '',
96  'SOAP-ENC:Array',
97  array(),
98  array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:string[]')),
99  'xsd:string'
100  );
101 
102  $this->server->wsdl->addComplexType(
103  'doubleArray',
104  'complexType',
105  'array',
106  '',
107  'SOAP-ENC:Array',
108  array(),
109  array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'xsd:double[]')),
110  'xsd:double'
111  );
112 
113  // It's not possible to register classes in nusoap
114 
115  // login()
116  $this->server->register(
117  'login',
118  array('client' => 'xsd:string',
119  'username' => 'xsd:string',
120  'password' => 'xsd:string'
121  ),
122  array('sid' => 'xsd:string'),
123  SERVICE_NAMESPACE,
124  SERVICE_NAMESPACE . '#login',
125  SERVICE_STYLE,
126  SERVICE_USE,
127  'ILIAS login function'
128  );
129 
130  // logout()
131  $this->server->register(
132  'logout',
133  array('sid' => 'xsd:string'),
134  array('success' => 'xsd:boolean'),
135  SERVICE_NAMESPACE,
136  SERVICE_NAMESPACE . '#logout',
137  SERVICE_STYLE,
138  SERVICE_USE,
139  'ILIAS logout function'
140  );
141  // user_data definitions
142  $this->server->wsdl->addComplexType(
143  'ilUserData',
144  'complexType',
145  'struct',
146  'all',
147  '',
148  array('usr_id' => array('name' => 'usr_id', 'type' => 'xsd:int'),
149  'login' => array('name' => 'login', 'type' => 'xsd:string'),
150  'passwd' => array('name' => 'passwd', 'type' => 'xsd:string'),
151  'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
152  'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'),
153  'title' => array('name' => 'title', 'type' => 'xsd:string'),
154  'gender' => array('name' => 'gender', 'type' => 'xsd:string'),
155  'email' => array('name' => 'email', 'type' => 'xsd:string'),
156  'second_email' => array('name' => 'second_email', 'type' => 'xsd:string'),
157  'institution' => array('name' => 'institution', 'type' => 'xsd:string'),
158  'street' => array('name' => 'street', 'type' => 'xsd:string'),
159  'city' => array('name' => 'city', 'type' => 'xsd:string'),
160  'zipcode' => array('name' => 'zipcode', 'type' => 'xsd:string'),
161  'country' => array('name' => 'country', 'type' => 'xsd:string'),
162  'phone_office' => array('name' => 'phone_office', 'type' => 'xsd:string'),
163  'last_login' => array('name' => 'last_login', 'type' => 'xsd:string'),
164  'last_update' => array('name' => 'last_update', 'type' => 'xsd:string'),
165  'create_date' => array('name' => 'create_date', 'type' => 'xsd:string'),
166  'hobby' => array('name' => 'hobby', 'type' => 'xsd:string'),
167  'department' => array('name' => 'department', 'type' => 'xsd:string'),
168  'phone_home' => array('name' => 'phone_home', 'type' => 'xsd:string'),
169  'phone_mobile' => array('name' => 'phone_mobile', 'type' => 'xsd:string'),
170  'fax' => array('name' => 'fax', 'type' => 'xsd:string'),
171  'time_limit_owner' => array('name' => 'time_limit_owner', 'type' => 'xsd:int'),
172  'time_limit_unlimited' => array('name' => 'time_limit_unlimited', 'type' => 'xsd:int'),
173  'time_limit_from' => array('name' => 'time_limit_from', 'type' => 'xsd:int'),
174  'time_limit_until' => array('name' => 'time_limit_until', 'type' => 'xsd:int'),
175  'time_limit_message' => array('name' => 'time_limit_message', 'type' => 'xsd:int'),
176  'referral_comment' => array('name' => 'referral_comment', 'type' => 'xsd:string'),
177  'matriculation' => array('name' => 'matriculation', 'type' => 'xsd:string'),
178  'active' => array('name' => 'active', 'type' => 'xsd:int'),
179  'accepted_agreement' => array('name' => 'accepted_agreement', 'type' => 'xsd:boolean'),
180  'approve_date' => array('name' => 'approve_date', 'type' => 'xsd:string'),
181  'user_skin' => array('name' => 'user_skin', 'type' => 'xsd:string'),
182  'user_style' => array('name' => 'user_style', 'type' => 'xsd:string'),
183  'user_language' => array('name' => 'user_language', 'type' => 'xsd:string'),
184  'import_id' => array('name' => 'import_id', 'type' => 'xsd:string')
185  )
186  );
187 
188  // lookupUser()
189  $this->server->register(
190  'lookupUser',
191  array('sid' => 'xsd:string',
192  'user_name' => 'xsd:string'
193  ),
194  array('usr_id' => 'xsd:int'),
195  SERVICE_NAMESPACE,
196  SERVICE_NAMESPACE . '#lookupUser',
197  SERVICE_STYLE,
198  SERVICE_USE,
199  'ILIAS lookupUser(): check if username exists. Return usr_id or 0 if lookup fails.'
200  );
201 
202 
203  // addCourse()
204  $this->server->register(
205  'addCourse',
206  array('sid' => 'xsd:string',
207  'target_id' => 'xsd:int',
208  'crs_xml' => 'xsd:string'
209  ),
210  array('course_id' => 'xsd:int'),
211  SERVICE_NAMESPACE,
212  SERVICE_NAMESPACE . '#addCourse',
213  SERVICE_STYLE,
214  SERVICE_USE,
215  'ILIAS addCourse(). Course import. See ilias_course_0_1.dtd for details about course xml structure'
216  );
217 
218  // deleteCourse()
219  $this->server->register(
220  'deleteCourse',
221  array('sid' => 'xsd:string',
222  'course_id' => 'xsd:int'
223  ),
224  array('success' => 'xsd:boolean'),
225  SERVICE_NAMESPACE,
226  SERVICE_NAMESPACE . '#deleteCourse',
227  SERVICE_STYLE,
228  SERVICE_USE,
229  'ILIAS deleteCourse(). Deletes a course. Delete courses are stored in "Trash" and can be undeleted in ' .
230  ' the ILIAS administration. '
231  );
232  // startBackgroundTaskWorker()
233  $this->server->register(
234  AsyncTaskManager::CMD_START_WORKER,
235  array('sid' => 'xsd:string'),
236  array('success' => 'xsd:boolean'),
237  SERVICE_NAMESPACE,
238  SERVICE_NAMESPACE . '#' . AsyncTaskManager::CMD_START_WORKER,
239  SERVICE_STYLE,
240  SERVICE_USE,
241  'ILIAS ' . AsyncTaskManager::CMD_START_WORKER . '().'
242  );
243 
244  // assignCourseMember()
245  $this->server->register(
246  'assignCourseMember',
247  array('sid' => 'xsd:string',
248  'course_id' => 'xsd:int',
249  'user_id' => 'xsd:int',
250  'type' => 'xsd:string'
251  ),
252  array('success' => 'xsd:boolean'),
253  SERVICE_NAMESPACE,
254  SERVICE_NAMESPACE . '#assignCourseMember',
255  SERVICE_STYLE,
256  SERVICE_USE,
257  'ILIAS assignCourseMember(). Assigns an user to an existing course. Type should be "Admin", "Tutor" or "Member"'
258  );
259 
260  // excludeCourseMember()
261  $this->server->register(
262  'excludeCourseMember',
263  array('sid' => 'xsd:string',
264  'course_id' => 'xsd:int',
265  'user_id' => 'xsd:int'
266  ),
267  array('success' => 'xsd:boolean'),
268  SERVICE_NAMESPACE,
269  SERVICE_NAMESPACE . '#excludeCourseMember',
270  SERVICE_STYLE,
271  SERVICE_USE,
272  'ILIAS excludeCourseMember(). Excludes an user from an existing course.'
273  );
274 
275  // isAssignedToCourse()
276  $this->server->register(
277  'isAssignedToCourse',
278  array('sid' => 'xsd:string',
279  'course_id' => 'xsd:int',
280  'user_id' => 'xsd:int'
281  ),
282  array('role' => 'xsd:int'),
283  SERVICE_NAMESPACE,
284  SERVICE_NAMESPACE . '#isAssignedToCourse',
285  SERVICE_STYLE,
286  SERVICE_USE,
287  'ILIAS isAssignedToCourse(). Checks whether an user is assigned to a given course. ' .
288  'Returns 0 => not assigned, 1 => course admin, 2 => course member or 3 => course tutor'
289  );
290 
291  // getCourseXML($sid,$course_id)
292  $this->server->register(
293  'getCourseXML',
294  array('sid' => 'xsd:string',
295  'course_id' => 'xsd:int'
296  ),
297  array('xml' => 'xsd:string'),
298  SERVICE_NAMESPACE,
299  SERVICE_NAMESPACE . '#getCourseXML',
300  SERVICE_STYLE,
301  SERVICE_USE,
302  'ILIAS getCourseXML(). Get a xml description of a specific course.'
303  );
304 
305  // updateCourse($sid,$course_id,$xml)
306  $this->server->register(
307  'updateCourse',
308  array('sid' => 'xsd:string',
309  'course_id' => 'xsd:int',
310  'xml' => 'xsd:string'
311  ),
312  array('success' => 'xsd:boolean'),
313  SERVICE_NAMESPACE,
314  SERVICE_NAMESPACE . '#updateCourse',
315  SERVICE_STYLE,
316  SERVICE_USE,
317  'ILIAS updateCourse(). Update course settings, assigned members, tutors, administrators with a ' .
318  'given xml description'
319  );
320 
321  // get obj_id by import id
322  $this->server->register(
323  'getObjIdByImportId',
324  array('sid' => 'xsd:string',
325  'import_id' => 'xsd:string'
326  ),
327  array('obj_id' => 'xsd:int'),
328  SERVICE_NAMESPACE,
329  SERVICE_NAMESPACE . '#getCourseIdByImportId',
330  SERVICE_STYLE,
331  SERVICE_USE,
332  'ILIAS getObjIdByImportId(). Get the obj_id of an ILIAS obj by a given import id.'
333  );
334 
335  // get ref ids by import id
336  $this->server->register(
337  'getRefIdsByImportId',
338  array('sid' => 'xsd:string',
339  'import_id' => 'xsd:string'
340  ),
341  array('ref_ids' => 'tns:intArray'),
342  SERVICE_NAMESPACE,
343  SERVICE_NAMESPACE . '#getRefIdsByImportId',
344  SERVICE_STYLE,
345  SERVICE_USE,
346  'ILIAS getRefIdsByImportId(). Get all reference ids by a given import id.'
347  );
348 
349  // get obj_id by import id
350  $this->server->register(
351  'getRefIdsByObjId',
352  array('sid' => 'xsd:string',
353  'obj_id' => 'xsd:string'
354  ),
355  array('ref_ids' => 'tns:intArray'),
356  SERVICE_NAMESPACE,
357  SERVICE_NAMESPACE . '#getRefIdsByObjId',
358  SERVICE_STYLE,
359  SERVICE_USE,
360  'ILIAS getRefIdsByObjId(). Get all reference ids by a given object id.'
361  );
362 
363  // Object administration
364  $this->server->register(
365  'getObjectByReference',
366  array('sid' => 'xsd:string',
367  'reference_id' => 'xsd:int',
368  'user_id' => 'xsd:int'
369  ),
370  array('object_xml' => 'xsd:string'),
371  SERVICE_NAMESPACE,
372  SERVICE_NAMESPACE . '#getObjectByReference',
373  SERVICE_STYLE,
374  SERVICE_USE,
375  'ILIAS getObjectByReference(). Get XML-description of an ILIAS object. If a user id is given, ' .
376  'this methods also checks the permissions of that user on the object.'
377  );
378 
379  $this->server->register(
380  'getObjectsByTitle',
381  array('sid' => 'xsd:string',
382  'title' => 'xsd:string',
383  'user_id' => 'xsd:int'
384  ),
385  array('object_xml' => 'xsd:string'),
386  SERVICE_NAMESPACE,
387  SERVICE_NAMESPACE . '#getObjectsByTitle',
388  SERVICE_STYLE,
389  SERVICE_USE,
390  'ILIAS getObjectsByTitle(). Get XML-description of an ILIAS object with given title. ' .
391  'If a user id is given this method also checks the permissions of that user on the object.'
392  );
393 
394  $this->server->register(
395  'searchObjects',
396  array('sid' => 'xsd:string',
397  'types' => 'tns:stringArray',
398  'key' => 'xsd:string',
399  'combination' => 'xsd:string',
400  'user_id' => 'xsd:int'
401  ),
402  array('object_xml' => 'xsd:string'),
403  SERVICE_NAMESPACE,
404  SERVICE_NAMESPACE . '#searchObjects',
405  SERVICE_STYLE,
406  SERVICE_USE,
407  'ILIAS searchObjects(): Searches for objects. Key is within "title" or "description" ' .
408  'Typical calls are searchObject($sid,array("lm","crs"),"\"this and that\"","and"); ' .
409  ' If an optional user id is given, this methods also return the permissions for that user ' .
410  'on the found objects'
411  );
412 
413  $this->server->register(
414  'getTreeChilds',
415  array('sid' => 'xsd:string',
416  'ref_id' => 'xsd:int',
417  'types' => 'tns:stringArray',
418  'user_id' => 'xsd:int'
419  ),
420  array('object_xml' => 'xsd:string'),
421  SERVICE_NAMESPACE,
422  SERVICE_NAMESPACE . '#getTreeChilds',
423  SERVICE_STYLE,
424  SERVICE_USE,
425  'ILIAS getTreeChilds(): Get all child objects of a given object.' .
426  'Choose array of types to filter the output. Choose empty type array to receive all object types'
427  );
428 
429  $this->server->register(
430  'getXMLTree',
431  array('sid' => 'xsd:string',
432  'ref_id' => 'xsd:int',
433  'types' => 'tns:stringArray',
434  'user_id' => 'xsd:int'
435  ),
436  array('object_xml' => 'xsd:string'),
437  SERVICE_NAMESPACE,
438  SERVICE_NAMESPACE . '#getXMLTree',
439  SERVICE_STYLE,
440  SERVICE_USE,
441  'ILIAS getXMLTree(): Returns a xml stream with the subtree objects.'
442  );
443 
444  $this->server->register(
445  'addObject',
446  array('sid' => 'xsd:string',
447  'target_id' => 'xsd:int',
448  'object_xml' => 'xsd:string'
449  ),
450  array('ref_id' => 'xsd:int'),
451  SERVICE_NAMESPACE,
452  SERVICE_NAMESPACE . '#addObject',
453  SERVICE_STYLE,
454  SERVICE_USE,
455  'ILIAS addObject. Create new object based on xml description under a given node ' .
456  '("category,course,group or folder). Return created reference id of the new object.'
457  );
458 
459  $this->server->register(
460  'updateObjects',
461  array('sid' => 'xsd:string',
462  'object_xml' => 'xsd:string'
463  ),
464  array('success' => 'xsd:boolean'),
465  SERVICE_NAMESPACE,
466  SERVICE_NAMESPACE . '#updateObjects',
467  SERVICE_STYLE,
468  SERVICE_USE,
469  'ILIAS updateObjects. Update object data (title,description,owner)'
470  );
471 
472  $this->server->register(
473  'addReference',
474  array('sid' => 'xsd:string',
475  'source_id' => 'xsd:int',
476  'target_id' => 'xsd:int'
477  ),
478  array('ref_id' => 'xsd:int'),
479  SERVICE_NAMESPACE,
480  SERVICE_NAMESPACE . '#addReference',
481  SERVICE_STYLE,
482  SERVICE_USE,
483  'ILIAS addReference. Create new link of given object to new object. Return the new reference id'
484  );
485 
486  $this->server->register(
487  'deleteObject',
488  array('sid' => 'xsd:string',
489  'reference_id' => 'xsd:int'
490  ),
491  array('success' => 'xsd:boolean'),
492  SERVICE_NAMESPACE,
493  SERVICE_NAMESPACE . '#deleteObject',
494  SERVICE_STYLE,
495  SERVICE_USE,
496  'ILIAS deleteObject. Stores object in trash. If multiple references exist, only the reference is deleted '
497  );
498 
499  $this->server->register(
500  'removeFromSystemByImportId',
501  array('sid' => 'xsd:string',
502  'import_id' => 'xsd:string'
503  ),
504  array('success' => 'xsd:boolean'),
505  SERVICE_NAMESPACE,
506  SERVICE_NAMESPACE . '#removeFromSystemByImportId',
507  SERVICE_STYLE,
508  SERVICE_USE,
509  'ILIAS removeFromSystemByImportId(). Removes an object identified by its import id permanently from the ' .
510  'system. All data will be deleted. There will be no possibility to restore it from the trash. Do not use ' .
511  'this function for deleting roles or users. Use deleteUser() or deleteRole() instead.'
512  );
513 
514  $this->server->register(
515  'addUserRoleEntry',
516  array('sid' => 'xsd:string',
517  'user_id' => 'xsd:int',
518  'role_id' => 'xsd:int'
519  ),
520  array('success' => 'xsd:boolean'),
521  SERVICE_NAMESPACE,
522  SERVICE_NAMESPACE . '#addUserRoleEntry',
523  SERVICE_STYLE,
524  SERVICE_USE,
525  'ILIAS addUserRoleEntry. Assign user to role.'
526  );
527 
528  $this->server->register(
529  'deleteUserRoleEntry',
530  array('sid' => 'xsd:string',
531  'user_id' => 'xsd:int',
532  'role_id' => 'xsd:int'
533  ),
534  array('success' => 'xsd:boolean'),
535  SERVICE_NAMESPACE,
536  SERVICE_NAMESPACE . '#deleteUserRoleEntry',
537  SERVICE_STYLE,
538  SERVICE_USE,
539  'ILIAS deleteUserRoleEntry. Deassign user from role.'
540  );
541 
542  // Add complex type for operations e.g array(array('name' => 'read','ops_id' => 2),...)
543  $this->server->wsdl->addComplexType(
544  'ilOperation',
545  'complexType',
546  'struct',
547  'all',
548  '',
549  array('ops_id' => array('name' => 'ops_id',
550  'type' => 'xsd:int'
551  ),
552  'operation' => array('name' => 'operation',
553  'type' => 'xsd:string'
554  ),
555  'description' => array('name' => 'description',
556  'type' => 'xsd:string'
557  )
558  )
559  );
560  // Now create an array of ilOperations
561  $this->server->wsdl->addComplexType(
562  'ilOperations',
563  'complexType',
564  'array',
565  '',
566  'SOAP-ENC:Array',
567  array(),
568  array(array('ref' => 'SOAP-ENC:arrayType',
569  'wsdl:arrayType' => 'tns:ilOperation[]'
570  )
571  ),
572  'tns:ilOperation'
573  );
574  $this->server->register(
575  'getOperations',
576  array('sid' => 'xsd:string'),
577  array('operations' => 'tns:ilOperations'),
578  SERVICE_NAMESPACE,
579  SERVICE_NAMESPACE . '#getOperations',
580  SERVICE_STYLE,
581  SERVICE_USE,
582  'ILIAS getOperations(): get complete set of RBAC operations.'
583  );
584 
585  $this->server->register(
586  'revokePermissions',
587  array('sid' => 'xsd:string',
588  'ref_id' => 'xsd:int',
589  'role_id' => 'xsd:int'
590  ),
591  array('success' => 'xsd:boolean'),
592  SERVICE_NAMESPACE,
593  SERVICE_NAMESPACE . '#revokePermissions',
594  SERVICE_STYLE,
595  SERVICE_USE,
596  'ILIAS revokePermissions(): Revoke all permissions for a specific role on an object.'
597  );
598 
599  $this->server->wsdl->addComplexType(
600  'ilOperationIds',
601  'complexType',
602  'array',
603  '',
604  'SOAP-ENC:Array',
605  array(),
606  array(array('ref' => 'SOAP-ENC:arrayType',
607  'wsdl:arrayType' => 'xsd:int[]'
608  )
609  ),
610  'xsd:int'
611  );
612 
613  $this->server->register(
614  'grantPermissions',
615  array('sid' => 'xsd:string',
616  'ref_id' => 'xsd:int',
617  'role_id' => 'xsd:int',
618  'operations' => 'tns:intArray'
619  ),
620  array('success' => 'xsd:boolean'),
621  SERVICE_NAMESPACE,
622  SERVICE_NAMESPACE . '#grantPermissions',
623  SERVICE_STYLE,
624  SERVICE_USE,
625  'ILIAS grantPermissions(): Grant permissions for a specific role on an object. ' .
626  '(Substitutes existing permission settings)'
627  );
628 
629  $this->server->register(
630  'getLocalRoles',
631  array('sid' => 'xsd:string',
632  'ref_id' => 'xsd:int'
633  ),
634  array('role_xml' => 'xsd:string'),
635  SERVICE_NAMESPACE,
636  SERVICE_NAMESPACE . '#getLocalRoles',
637  SERVICE_STYLE,
638  SERVICE_USE,
639  'ILIAS getLocalRoles(): Get all local roles assigned to an specific object.'
640  );
641 
642  $this->server->register(
643  'getUserRoles',
644  array('sid' => 'xsd:string',
645  'user_id' => 'xsd:int'
646  ),
647  array('role_xml' => 'xsd:string'),
648  SERVICE_NAMESPACE,
649  SERVICE_NAMESPACE . '#getLocalRoles',
650  SERVICE_STYLE,
651  SERVICE_USE,
652  'ILIAS getUserRoles(): Get all local roles assigned to an specific user. '
653  );
654 
655  $this->server->register(
656  'addRole',
657  array('sid' => 'xsd:string',
658  'target_id' => 'xsd:int',
659  'obj_xml' => 'xsd:string'
660  ),
661  array('role_ids' => 'tns:intArray'),
662  SERVICE_NAMESPACE,
663  SERVICE_NAMESPACE . '#addRole',
664  SERVICE_STYLE,
665  SERVICE_USE,
666  'ILIAS addRole(): Creates new role under given node. "target_id" is the reference id of an ILIAS ' .
667  'ILIAS object. E.g ref_id of crs,grp. If no role folder exists, a new role folder will be created.'
668  );
669 
670  $this->server->register(
671  'deleteRole',
672  array('sid' => 'xsd:string',
673  'role_id' => 'xsd:int'
674  ),
675  array('success' => 'xsd:boolean'),
676  SERVICE_NAMESPACE,
677  SERVICE_NAMESPACE . '#deleteRole',
678  SERVICE_STYLE,
679  SERVICE_USE,
680  'ILIAS deleteRole(): Deletes an role and all user assignments. Fails if it is the last role of an user'
681  );
682 
683  $this->server->register(
684  'addRoleFromTemplate',
685  array('sid' => 'xsd:string',
686  'target_id' => 'xsd:int',
687  'obj_xml' => 'xsd:string',
688  'role_template_id' => 'xsd:int'
689  ),
690  array('role_ids' => 'tns:intArray'),
691  SERVICE_NAMESPACE,
692  SERVICE_NAMESPACE . '#addRole',
693  SERVICE_STYLE,
694  SERVICE_USE,
695  'ILIAS addRole(): Creates new role under given node. "target_id" is the reference id of an ILIAS ' .
696  'ILIAS object. E.g ref_id of crs,grp. If no role folder exists, a new role folder will be created. ' .
697  'In addition to addRole the template permissions will be copied from the given role template'
698  );
699 
700  $this->server->register(
701  'getObjectTreeOperations',
702  array('sid' => 'xsd:string',
703  'ref_id' => 'xsd:int',
704  'user_id' => 'xsd:int'
705  ),
706  array('operations' => 'tns:ilOperations'),
707  SERVICE_NAMESPACE,
708  SERVICE_NAMESPACE . '#getPermissionsForObject',
709  SERVICE_STYLE,
710  SERVICE_USE,
711  'ILIAS getObjectTreeOperations(): Get all granted permissions for all references of ' .
712  'an object for a specific user. Returns array of granted operations or empty array'
713  );
714 
715  $this->server->register(
716  'addGroup',
717  array('sid' => 'xsd:string',
718  'target_id' => 'xsd:int',
719  'group_xml' => 'xsd:string'
720  ),
721  array('ref_id' => 'xsd:int'),
722  SERVICE_NAMESPACE,
723  SERVICE_NAMESPACE . '#addGroup',
724  SERVICE_STYLE,
725  SERVICE_USE,
726  'ILIAS addGroup(): Add grop according to valid group XML ' .
727  '@See ilias_group_0_1.dtd'
728  );
729 
730  $this->server->register(
731  'groupExists',
732  array('sid' => 'xsd:string',
733  'title' => 'xsd:string'
734  ),
735  array('exists' => 'xsd:boolean'),
736  SERVICE_NAMESPACE,
737  SERVICE_NAMESPACE . '#groupExists',
738  SERVICE_STYLE,
739  SERVICE_USE,
740  'ILIAS addGroup(): Check if group with given name exists. '
741  );
742 
743  // getGroup
744  $this->server->register(
745  'getGroup',
746  array('sid' => 'xsd:string',
747  'ref_id' => 'xsd:int'
748  ),
749  array('group_xml' => 'xsd:string'),
750  SERVICE_NAMESPACE,
751  SERVICE_NAMESPACE . '#getGroup',
752  SERVICE_STYLE,
753  SERVICE_USE,
754  'ILIAS getGroup(): get xml description of grouip with given reference id.'
755  );
756 
757  // assignGroupMember()
758  $this->server->register(
759  'assignGroupMember',
760  array('sid' => 'xsd:string',
761  'group_id' => 'xsd:int',
762  'user_id' => 'xsd:int',
763  'type' => 'xsd:string'
764  ),
765  array('success' => 'xsd:boolean'),
766  SERVICE_NAMESPACE,
767  SERVICE_NAMESPACE . '#assignGroupMember',
768  SERVICE_STYLE,
769  SERVICE_USE,
770  'ILIAS assignGroupMember(). Assigns an user to an existing group. Type should be "Admin","Member"'
771  );
772 
773  // excludeGroupMember()
774  $this->server->register(
775  'excludeGroupMember',
776  array('sid' => 'xsd:string',
777  'group_id' => 'xsd:int',
778  'user_id' => 'xsd:int'
779  ),
780  array('success' => 'xsd:boolean'),
781  SERVICE_NAMESPACE,
782  SERVICE_NAMESPACE . '#excludeGroupMember',
783  SERVICE_STYLE,
784  SERVICE_USE,
785  'ILIAS excludeGroupMember(). Excludes an user from an existing group.'
786  );
787 
788  // isAssignedToGroup()
789  $this->server->register(
790  'isAssignedToGroup',
791  array('sid' => 'xsd:string',
792  'group_id' => 'xsd:int',
793  'user_id' => 'xsd:int'
794  ),
795  array('role' => 'xsd:int'),
796  SERVICE_NAMESPACE,
797  SERVICE_NAMESPACE . '#isAssignedToGroup',
798  SERVICE_STYLE,
799  SERVICE_USE,
800  'ILIAS isAssignedToGroup(). Checks whether an user is assigned to a given group. ' .
801  'Returns 0 => not assigned, 1 => group admin, 2 => group member'
802  );
803 
804 
805  // Clone functions
806  $this->server->register(
807  'ilClone',
808  array('sid' => 'xsd:string', 'copy_identifier' => 'xsd:int'),
809  array('new_ref_id' => 'xsd:int'),
810  SERVICE_NAMESPACE,
811  SERVICE_NAMESPACE . '#ilClone',
812  SERVICE_STYLE,
813  SERVICE_USE,
814  'ILIAS ilClone(): Only for internal usage.' .
815  'Syntax, parameters may change in future releases. '
816  );
817 
818  $this->server->register(
819  'ilCloneDependencies',
820  array('sid' => 'xsd:string', 'copy_identifier' => 'xsd:int'),
821  array('success' => 'xsd:boolean'),
822  SERVICE_NAMESPACE,
823  SERVICE_NAMESPACE . '#ilCloneDependencies',
824  SERVICE_STYLE,
825  SERVICE_USE,
826  'ILIAS ilCloneDependencies(): Only for internal usage.' .
827  'Syntax, parameters may change in future releases. '
828  );
829 
830 
831  $this->server->register(
832  'saveQuestion',
833  array('sid' => 'xsd:string',
834  'active_id' => 'xsd:long',
835  'question_id' => 'xsd:long',
836  'pass' => 'xsd:int',
837  'solution' => 'tns:stringArray'
838  ),
839  array('status' => 'xsd:boolean'),
840  SERVICE_NAMESPACE,
841  SERVICE_NAMESPACE . '#saveQuestion',
842  SERVICE_STYLE,
843  SERVICE_USE,
844  'ILIAS saveQuestion: Saves the result of a question in a given test pass for the active test user. The active user is identified by the active ID, which assigns a user to a test.'
845  );
846 
847  $this->server->register(
848  'saveQuestionSolution',
849  array('sid' => 'xsd:string',
850  'active_id' => 'xsd:long',
851  'question_id' => 'xsd:long',
852  'pass' => 'xsd:int',
853  'solution' => 'xsd:string'
854  ),
855  array('status' => 'xsd:string'),
856  SERVICE_NAMESPACE,
857  SERVICE_NAMESPACE . '#saveQuestionSolution',
858  SERVICE_STYLE,
859  SERVICE_USE,
860  'ILIAS saveQuestionSolution: Saves the result of a question in a given test pass for the active test user. The active user is identified by the active ID, which assigns a user to a test. The solution has to be an XML string which contains &lt;values&gt;&lt;value&gt;VALUE&lt;/value&gt;&lt;value&gt;VALUE&lt;/value&gt;&lt;points&gt;POINTS&lt;/points&gt;...&lt;/values&gt; where the triplet (value,value,points) can repeat n times. The result string is either TRUE or it contains an error message.'
861  );
862 
863  $this->server->register(
864  'getQuestionSolution',
865  array('sid' => 'xsd:string',
866  'active_id' => 'xsd:long',
867  'question_id' => 'xsd:int',
868  'pass' => 'xsd:int'
869  ),
870  array('solution' => 'tns:stringArray'),
871  SERVICE_NAMESPACE,
872  SERVICE_NAMESPACE . '#getQuestionSolution',
873  SERVICE_STYLE,
874  SERVICE_USE,
875  'ILIAS getQuestionSolution: Typically called from external assessment questions to retrieve the previous input of a user.'
876  );
877 
878  $this->server->register(
879  'getTestUserData',
880  array('sid' => 'xsd:string',
881  'active_id' => 'xsd:long'
882  ),
883  array('userdata' => 'tns:stringArray'),
884  SERVICE_NAMESPACE,
885  SERVICE_NAMESPACE . '#getTestUserData',
886  SERVICE_STYLE,
887  SERVICE_USE,
888  'ILIAS getTestUserData: Typically called from external assessment questions to retrieve data of the active user. The returned string array values are fullname, title, firstname, lastname, login.'
889  );
890 
891  $this->server->register(
892  'getPositionOfQuestion',
893  array('sid' => 'xsd:string',
894  'active_id' => 'xsd:long',
895  'question_id' => 'xsd:int',
896  'pass' => 'xsd:int'
897  ),
898  array('position' => 'xsd:int'),
899  SERVICE_NAMESPACE,
900  SERVICE_NAMESPACE . '#getPositionOfQuestion',
901  SERVICE_STYLE,
902  SERVICE_USE,
903  'ILIAS getPositionOfQuestion: Returns the position of a given question for a given user in a given test pass.'
904  );
905 
906  $this->server->register(
907  'getPreviousReachedPoints',
908  array('sid' => 'xsd:string',
909  'active_id' => 'xsd:long',
910  'question_id' => 'xsd:int',
911  'pass' => 'xsd:int'
912  ),
913  array('position' => 'tns:doubleArray'),
914  SERVICE_NAMESPACE,
915  SERVICE_NAMESPACE . '#getPreviousReachedPoints',
916  SERVICE_STYLE,
917  SERVICE_USE,
918  'ILIAS getPreviousReachedPoints: Returns an array of reached points for the previous questions in a given test pass.'
919  );
920 
921  $this->server->register(
922  'getNrOfQuestionsInPass',
923  array('sid' => 'xsd:string',
924  'active_id' => 'xsd:long',
925  'pass' => 'xsd:int'
926  ),
927  array('count' => 'xsd:int'),
928  SERVICE_NAMESPACE,
929  SERVICE_NAMESPACE . '#getNrOfQuestionsInPass',
930  SERVICE_STYLE,
931  SERVICE_USE,
932  'ILIAS getNrOfQuestionsInPass: Returns the question count for a given test user in a given pass.'
933  );
934 
935  $this->server->register(
936  'getStructureObjects',
937  array('sid' => 'xsd:string',
938  'ref_id' => 'xsd:int'
939  ),
940  array('xml' => 'xsd:string'),
941  SERVICE_NAMESPACE,
942  SERVICE_NAMESPACE . '#getStructureObjects',
943  SERVICE_STYLE,
944  SERVICE_USE,
945  'ILIAS getStructureObjects: delivers structure of content objects like learning modules (chapters/pages) or glossary (terms)'
946  );
947 
948  // importUsers()
949  $this->server->register(
950  'importUsers',
951  array('sid' => 'xsd:string',
952  'folder_id' => 'xsd:int',
953  'usr_xml' => 'xsd:string',
954  'conflict_rule' => 'xsd:int',
955  'send_account_mail' => 'xsd:int'
956  ),
957  array('protocol' => 'xsd:string'),
958  SERVICE_NAMESPACE,
959  SERVICE_NAMESPACE . '#importUsers',
960  SERVICE_STYLE,
961  SERVICE_USE,
962  'ILIAS import users into folder id, which should be ref_id of folder or user folder (-1:System user folder, 0: checks access at user level, otherwise refid): conflict_rule: IL_FAIL_ON_CONFLICT = 1, IL_UPDATE_ON_CONFLICT = 2, IL_IGNORE_ON_CONFLICT = 3. The Return-Value is a protocol with the columns userid, login, action, message, following xmlresultset dtd. Send Account Mail = 0 deactivates sending a mail to each user, 1 activates it'
963  );
964 
965  $this->server->register(
966  'getRoles',
967  array('sid' => 'xsd:string',
968  'role_type' => 'xsd:string',
969  'id' => 'xsd:string'
970  ),
971  array('role_xml' => 'xsd:string'),
972  SERVICE_NAMESPACE,
973  SERVICE_NAMESPACE . '#getRoles',
974  SERVICE_STYLE,
975  SERVICE_USE,
976  'ILIAS getRoles():if id equals -1, get all roles specified by type (global|local|user|user_login|template or empty), if type is empty all roles with all types are delivered, if id > -1 and role_type <> user or user_login, delivers all roles which belong to a repository object with specified ref_id, if roletype is user a numeric id is interpreted as userid, if roletype is user_login it is interpreted as login,if roletype is template all role templates will be listed'
977  );
978 
979  $this->server->register(
980  'getUsersForContainer',
981  array('sid' => 'xsd:string',
982  'ref_id' => 'xsd:int',
983  'attach_roles' => 'xsd:int',
984  'active' => 'xsd:int'
985  ),
986  array('user_xml' => 'xsd:string'),
987  SERVICE_NAMESPACE,
988  SERVICE_NAMESPACE . '#getUsersForContainer',
989  SERVICE_STYLE,
990  SERVICE_USE,
991  'ILIAS getUsersForContainer(): get all users of a specific ref_id, which can be crs, group, category or user folder (value: -1). Choose if all roles of a user should be attached (1) or not (0). set active to -1 to get all, 0, to get inactive users only, 1 to get active users only'
992  );
993 
994  $this->server->register(
995  'getUsersForRole',
996  array('sid' => 'xsd:string',
997  'role_id' => 'xsd:int',
998  'attach_roles' => 'xsd:int',
999  'active' => 'xsd:int'
1000  ),
1001  array('user_xml' => 'xsd:string'),
1002  SERVICE_NAMESPACE,
1003  SERVICE_NAMESPACE . '#getUsersForRole',
1004  SERVICE_STYLE,
1005  SERVICE_USE,
1006  'ILIAS getUsersForRole(): get all users of a role with specified id, specify attach_roles to 1, to attach all role assignmnents; specify active: 1, to import active only, 0: inactive only, -1: both'
1007  );
1008 
1009  $this->server->register(
1010  'searchUser',
1011  array('sid' => 'xsd:string',
1012  'key_fields' => 'tns:stringArray',
1013  'query_operator' => 'xsd:string',
1014  'key_values' => 'tns:stringArray',
1015  'attach_roles' => 'xsd:int',
1016  'active' => 'xsd:int'
1017  ),
1018  array('user_xml' => 'xsd:string'),
1019  SERVICE_NAMESPACE,
1020  SERVICE_NAMESPACE . '#searchUsers',
1021  SERVICE_STYLE,
1022  SERVICE_USE,
1023  'ILIAS searchUser(): get all users, which match a query, consisting of the keyfields, matched with values of the field values, concatenated with the logical query operator. Specify attach_roles to 1, to attach all role assignmnents; specify active: 1, to import active only, 0: inactive only, -1: both'
1024  );
1025 
1026  // Mail Functions
1027  // Check whether current user has new mail
1028  $this->server->register(
1029  'hasNewMail',
1030  array('sid' => 'xsd:string'),
1031  array('status' => 'xsd:boolean'),
1032  SERVICE_NAMESPACE,
1033  SERVICE_NAMESPACE . '#hasNewMail',
1034  SERVICE_STYLE,
1035  SERVICE_USE,
1036  'ILIAS hasNewMail(): Checks whether the current authenticated user has a new mail.'
1037  );
1038 
1039  $this->server->register(
1040  'getExerciseXML',
1041  array('sid' => 'xsd:string', "ref_id" => 'xsd:int', "attachment_mode" => "xsd:int"),
1042  array('exercisexml' => 'xsd:string'),
1043  SERVICE_NAMESPACE,
1044  SERVICE_NAMESPACE . '#getExerciseXML',
1045  SERVICE_STYLE,
1046  SERVICE_USE,
1047  'ILIAS getExerciseXML(): returns xml description of exercise. Attachment mode: 0 - no file contents, 1 - plain content (base64encoded), 2 zlib + base64, 3 gzip + base64)'
1048  );
1049 
1050  $this->server->register(
1051  'addExercise',
1052  array('sid' => 'xsd:string', "target_id" => 'xsd:int', "xml" => "xsd:string"),
1053  array('refid' => 'xsd:int'),
1054  SERVICE_NAMESPACE,
1055  SERVICE_NAMESPACE . '#addExercise',
1056  SERVICE_STYLE,
1057  SERVICE_USE,
1058  'ILIAS addExercise(): create exercise, put it into target (ref_id) and update exercise properties from xml (see ilias_exercise_3_8.dtd for details). Obj_id must not be set!'
1059  );
1060 
1061  $this->server->register(
1062  'updateExercise',
1063  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'xml' => 'xsd:string'),
1064  array('success' => 'xsd:boolean'),
1065  SERVICE_NAMESPACE,
1066  SERVICE_NAMESPACE . '#updateExercise',
1067  SERVICE_STYLE,
1068  SERVICE_USE,
1069  'ILIAS updateExercise():update existing exercise, update exercise properties from xml (see ilias_exercise_3_8.dtd for details). obj_id in xml must match according obj id of refid.!'
1070  );
1071 
1072  $this->server->register(
1073  'getFileXML',
1074  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'attachment_mode' => 'xsd:int'),
1075  array('filexml' => 'xsd:string'),
1076  SERVICE_NAMESPACE,
1077  SERVICE_NAMESPACE . '#getFileXML',
1078  SERVICE_STYLE,
1079  SERVICE_USE,
1080  'ILIAS getFileXML(): returns xml description of file. Attachment mode: 0 - no file contents, 1 - plain content (base64encoded), 2 zlib + base64, 3 gzip + base64)'
1081  );
1082 
1083  $this->server->register(
1084  'addFile',
1085  array('sid' => 'xsd:string', 'target_id' => 'xsd:int', 'xml' => 'xsd:string'),
1086  array('refid' => 'xsd:int'),
1087  SERVICE_NAMESPACE,
1088  SERVICE_NAMESPACE . '#addFile',
1089  SERVICE_STYLE,
1090  SERVICE_USE,
1091  'ILIAS addFile(): create file, put it into target (ref_id) and update file properties from xml (see ilias_file_3_8.dtd for details). Obj_id must not be set!'
1092  );
1093 
1094  $this->server->register(
1095  'updateFile',
1096  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'xml' => 'xsd:string'),
1097  array('success' => 'xsd:boolean'),
1098  SERVICE_NAMESPACE,
1099  SERVICE_NAMESPACE . '#updateFile',
1100  SERVICE_STYLE,
1101  SERVICE_USE,
1102  'ILIAS updateFile():update existing file, update file properties from xml (see ilias_file_3_8.dtd for details). obj_id in xml must match according obj id of refid.!'
1103  );
1104 
1105  $this->server->register(
1106  'getUserXML',
1107  array('sid' => 'xsd:string', 'user_ids' => 'tns:intArray', 'attach_roles' => 'xsd:int'),
1108  array('xml' => 'xsd:string'),
1109  SERVICE_NAMESPACE,
1110  SERVICE_NAMESPACE . '#resolveUsers',
1111  SERVICE_STYLE,
1112  SERVICE_USE,
1113  'ILIAS getUserXML(): get xml records for user ids, e.g. retrieved vom members of course xml. Returns user xml dtds. ids are numeric ids of user'
1114  );
1115 
1116  // get objs ids by ref id
1117  $this->server->register(
1118  'getObjIdsByRefIds',
1119  array('sid' => 'xsd:string',
1120  'ref_ids' => 'tns:intArray'
1121  ),
1122  array('obj_ids' => 'tns:intArray'),
1123  SERVICE_NAMESPACE,
1124  SERVICE_NAMESPACE . '#getRefIdsByImportId',
1125  SERVICE_STYLE,
1126  SERVICE_USE,
1127  'ILIAS getObjIdsForRefIds: Returns a array of object ids which match the references id, given by a comma seperated string. Returns an array of ref ids, in the same order as object ids. Therefore, there might by duplicates'
1128  );
1129 
1130  $this->server->register(
1131  'updateGroup',
1132  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'xml' => 'xsd:string'),
1133  array('success' => 'xsd:boolean'),
1134  SERVICE_NAMESPACE,
1135  SERVICE_NAMESPACE . '#updateGroup',
1136  SERVICE_STYLE,
1137  SERVICE_USE,
1138  'ILIAS updateGroup(): update existing group using ref id and group xml (see DTD).'
1139  );
1140 
1141  $this->server->register(
1142  'getIMSManifestXML',
1143  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int'),
1144  array('xml' => 'xsd:string'),
1145  SERVICE_NAMESPACE,
1146  SERVICE_NAMESPACE . '#getIMSManifestXML',
1147  SERVICE_STYLE,
1148  SERVICE_USE,
1149  'ILIAS getIMSManifestXML(): returns xml of ims manifest file (scorm learning module) referred by refid'
1150  );
1151 
1152  $this->server->register(
1153  'hasSCORMCertificate',
1154  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'usr_id' => 'xsd:int'),
1155  array('success' => 'xsd:boolean'),
1156  SERVICE_NAMESPACE,
1157  SERVICE_NAMESPACE . '#hasSCORMCertificate',
1158  SERVICE_STYLE,
1159  SERVICE_USE,
1160  'ILIAS hasSCORMCertificate(): returns true if a certficate is available for a user referred by usr_id in a SCORM learning module referred by ref_id'
1161  );
1162 
1163  $this->server->register(
1164  'getSCORMCompletionStatus',
1165  array('sid' => 'xsd:string', 'usr_id' => 'xsd:int', 'ref_id' => 'xsd:int'),
1166  array('status' => 'xsd:string'),
1167  SERVICE_NAMESPACE,
1168  SERVICE_NAMESPACE . '#getSCORMCompletionStatus',
1169  SERVICE_STYLE,
1170  SERVICE_USE,
1171  'ILIAS getSCORMCompletionStatus(): returns a completion status of a scorm module'
1172  );
1173 
1174  $this->server->register(
1175  'copyObject',
1176  array('sid' => 'xsd:string', 'xml' => 'xsd:string'),
1177  array('xml' => 'xsd:int'),
1178  SERVICE_NAMESPACE,
1179  SERVICE_NAMESPACE . '#copyObject',
1180  SERVICE_STYLE,
1181  SERVICE_USE,
1182  'ILIAS copyObject(): returns reference of copy, if copy is created directly, or the ref id of the target if copy is in progress.'
1183  );
1184 
1185  $this->server->register(
1186  'moveObject',
1187  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'target_id' => 'xsd:int'),
1188  array('result' => 'xsd:boolean'),
1189  SERVICE_NAMESPACE,
1190  SERVICE_NAMESPACE . '#moveObject',
1191  SERVICE_STYLE,
1192  SERVICE_USE,
1193  'ILIAS moveObject(): returns true, if object with refid could be successfully moved to target id, other it raises an error.'
1194  );
1195 
1196  $this->server->register(
1197  'getTestResults',
1198  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'sum_only' => 'xsd:boolean'),
1199  array('xml' => 'xsd:string'),
1200  SERVICE_NAMESPACE,
1201  SERVICE_NAMESPACE . '#getTestResults',
1202  SERVICE_STYLE,
1203  SERVICE_USE,
1204  'ILIAS getTestResults(): returns XMLResultSet with
1205  sum only = true: user_id, login, firstname, lastname, matriculation, maximum points, received points
1206  sum only = false: user_id, login, firstname, lastname, matriculation, question id, question title, question points, received points'
1207  );
1208 
1209  $this->server->register(
1210  'removeTestResults',
1211  array(
1212  'sid' => 'xsd:string',
1213  'ref_id' => 'xsd:int',
1214  'user_ids' => 'tns:intArray'
1215  ),
1216  array('success' => 'xsd:boolean'),
1217  SERVICE_NAMESPACE,
1218  SERVICE_NAMESPACE . '#removeTestResults',
1219  SERVICE_STYLE,
1220  SERVICE_USE,
1221  'ILIAS removeTestResults(): remove test results for the chosen users'
1222  );
1223 
1224  $this->server->register(
1225  'getCoursesForUser',
1226  array('sid' => 'xsd:string', 'parameters' => 'xsd:string'),
1227  array('xml' => 'xsd:string'),
1228  SERVICE_NAMESPACE,
1229  SERVICE_NAMESPACE . '#getCoursesForUser',
1230  SERVICE_STYLE,
1231  SERVICE_USE,
1232  'ILIAS getTestResults(): returns XMLResultSet with columns ref_id, course xml. $parameters has to contain a column user_id and a column status. Status is a logical AND combined value of (MEMBER = 1, TUTOR = 2, ADMIN = 4, OWNER = 8) and determines which courses should be returned.'
1233  );
1234 
1235  $this->server->register(
1236  'getGroupsForUser',
1237  array('sid' => 'xsd:string', 'parameters' => 'xsd:string'),
1238  array('xml' => 'xsd:string'),
1239  SERVICE_NAMESPACE,
1240  SERVICE_NAMESPACE . '#getGroupsForUser',
1241  SERVICE_STYLE,
1242  SERVICE_USE,
1243  'ILIAS getTestResults(): returns XMLResultSet with columns ref_id, group xml. $parameters has to contain a column user_id and a column status. Status is a logical AND combined value of (MEMBER = 1, TUTOR = 2, OWNER = 4) and determines which groups should be returned.'
1244  );
1245 
1246  $this->server->register(
1247  'getPathForRefId',
1248  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int'),
1249  array('xml' => 'xsd:string'),
1250  SERVICE_NAMESPACE,
1251  SERVICE_NAMESPACE . '#getPathForRefId',
1252  SERVICE_STYLE,
1253  SERVICE_USE,
1254  'ILIAS getPathForRefId(): returns XMLResultSet with columns ref_id, type and title.'
1255  );
1256 
1257  $this->server->register(
1258  'searchRoles',
1259  array('sid' => 'xsd:string',
1260  'key' => 'xsd:string',
1261  'combination' => 'xsd:string',
1262  'role_type' => 'xsd:string'
1263  ),
1264  array('xml' => 'xsd:string'),
1265  SERVICE_NAMESPACE,
1266  SERVICE_NAMESPACE . '#searchRoles',
1267  SERVICE_STYLE,
1268  SERVICE_USE,
1269  'ILIAS searchRoles(): returns XML following role dtd with search results for given role type and search terms.'
1270  );
1271 
1272  $this->server->register(
1273  'getInstallationInfoXML',
1274  array(),
1275  array('xml' => 'xsd:string'),
1276  SERVICE_NAMESPACE,
1277  SERVICE_NAMESPACE . '#getInstallationInfoXML',
1278  SERVICE_STYLE,
1279  SERVICE_USE,
1280  'ILIAS getInstallationInfoXML(): returns XML following installation_info dtd'
1281  );
1282 
1283  $this->server->register(
1284  'getClientInfoXML',
1285  array('clientid' => 'xsd:string'),
1286  array('xml' => 'xsd:string'),
1287  SERVICE_NAMESPACE,
1288  SERVICE_NAMESPACE . '#getClientInfoXML',
1289  SERVICE_STYLE,
1290  SERVICE_USE,
1291  'ILIAS getClientInfoXML(): returns XML following installation_info dtd, contains the client the data of given client id'
1292  );
1293 
1294  $this->server->register(
1295  'getSkillCompletionDateForTriggerRefId',
1296  array('sid' => 'xsd:string',
1297  'user_id' => 'xsd:string',
1298  'ref_id' => 'xsd:string'
1299  ),
1300  array('dates' => 'xsd:string'),
1301  SERVICE_NAMESPACE,
1302  SERVICE_NAMESPACE . '#getSkillCompletionDateForTriggerRefId',
1303  SERVICE_STYLE,
1304  SERVICE_USE,
1305  'ILIAS getSkillCompletionDateForTriggerRefId(). Get completion dates for skill trigger ref ids.'
1306  );
1307 
1308  $this->server->register(
1309  'checkSkillUserCertificateForTriggerRefId',
1310  array('sid' => 'xsd:string',
1311  'user_id' => 'xsd:string',
1312  'ref_id' => 'xsd:string'
1313  ),
1314  array('have_certificates' => 'xsd:string'),
1315  SERVICE_NAMESPACE,
1316  SERVICE_NAMESPACE . '#checkSkillUserCertificateForTriggerRefId',
1317  SERVICE_STYLE,
1318  SERVICE_USE,
1319  'ILIAS checkSkillUserCertificateForTriggerRefId(). Check user certificates for trigger ref ids.'
1320  );
1321 
1322  $this->server->register(
1323  'getSkillTriggerOfAllCertificates',
1324  array('sid' => 'xsd:string',
1325  'user_id' => 'xsd:string'
1326  ),
1327  array('certificate_triggers' => 'xsd:string'),
1328  SERVICE_NAMESPACE,
1329  SERVICE_NAMESPACE . '#getSkillTriggerOfAllCertificates',
1330  SERVICE_STYLE,
1331  SERVICE_USE,
1332  'ILIAS getSkillTriggerOfAllCertificates(). Check get all trigger with certificate for a user.'
1333  );
1334 
1335  $this->server->register(
1336  'getUserIdBySid',
1337  array('sid' => 'xsd:string'),
1338  array('usr_id' => 'xsd:int'),
1339  SERVICE_NAMESPACE,
1340  SERVICE_NAMESPACE . '#getUserIdBySid',
1341  SERVICE_STYLE,
1342  SERVICE_USE,
1343  'ILIAS getUserIdBySid(): returns an ILIAS usr_id for the given sid'
1344  );
1345 
1346  $this->server->register(
1347  'deleteExpiredDualOptInUserObjects',
1348  array('sid' => 'xsd:string',
1349  'usr_id' => 'xsd:int'
1350  ),
1351  array('status' => 'xsd:boolean'),
1352  SERVICE_NAMESPACE,
1353  SERVICE_NAMESPACE . '#deleteExpiredDualOptInUserObjects',
1354  SERVICE_STYLE,
1355  SERVICE_USE,
1356  'ILIAS deleteExpiredDualOptInUserObjects(): Deletes expired user accounts caused by unconfirmed registration links in "dual opt in" registration method'
1357  );
1358 
1359  $this->server->register(
1360  'readWebLink',
1361  array('sid' => 'xsd:string', "ref_id" => 'xsd:int'),
1362  array('weblinkxml' => 'xsd:string'),
1363  SERVICE_NAMESPACE,
1364  SERVICE_NAMESPACE . '#readWebLink',
1365  SERVICE_STYLE,
1366  SERVICE_USE,
1367  'ILIAS readWebLink(): returns xml description of a weblink container.'
1368  );
1369 
1370  $this->server->register(
1371  'createWebLink',
1372  array('sid' => 'xsd:string', "target_id" => 'xsd:int', "xml" => "xsd:string"),
1373  array('refid' => 'xsd:int'),
1374  SERVICE_NAMESPACE,
1375  SERVICE_NAMESPACE . '#createWebLink',
1376  SERVICE_STYLE,
1377  SERVICE_USE,
1378  'ILIAS createWebLink(): create web link container, put it into target (ref_id) and update weblink container from xml (see ilias_weblink_4_0.dtd for details). Obj_id must not be set!'
1379  );
1380 
1381  $this->server->register(
1382  'updateWebLink',
1383  array('sid' => 'xsd:string', 'ref_id' => 'xsd:int', 'xml' => 'xsd:string'),
1384  array('success' => 'xsd:boolean'),
1385  SERVICE_NAMESPACE,
1386  SERVICE_NAMESPACE . '#updateWebLink',
1387  SERVICE_STYLE,
1388  SERVICE_USE,
1389  'ILIAS updateWebLink():update existing weblink, update weblink properties from xml (see ilias_weblink_4_0.dtd for details).'
1390  );
1391 
1392  // mcs-patch start
1393  $this->server->register(
1394  'getLearningProgressChanges',
1395  array('sid' => 'xsd:string',
1396  'timestamp' => 'xsd:string',
1397  'include_ref_ids' => 'xsd:boolean',
1398  'type_filter' => 'tns:stringArray'
1399  ),
1400  array('lp_data' => 'xsd:string'),
1401  SERVICE_NAMESPACE,
1402  SERVICE_NAMESPACE . '#getLearningProgressChanges',
1403  SERVICE_STYLE,
1404  SERVICE_USE,
1405  'ILIAS getLearningProgressChanges(): Get learning progress changes after a given timestamp.'
1406  );
1407  // mcs-patch end
1408 
1409  $this->server->register(
1410  'deleteProgress',
1411  array(
1412  'sid' => 'xsd:string',
1413  'ref_ids' => 'tns:intArray',
1414  'usr_ids' => 'tns:intArray',
1415  'type_filter' => 'tns:stringArray',
1416  'progress_filter' => 'tns:intArray'
1417  ),
1418  array('status' => 'xsd:boolean'),
1419  SERVICE_NAMESPACE,
1420  SERVICE_NAMESPACE . '#deleteProgress',
1421  SERVICE_STYLE,
1422  SERVICE_USE,
1423  'Delete user progress data of objects. '
1424  );
1425 
1426  $this->server->register(
1427  'getProgressInfo',
1428  array(
1429  'sid' => 'xsd:string',
1430  'ref_id' => 'xsd:int',
1431  'progress_filter' => 'tns:intArray'
1432  ),
1433  array('user_results' => 'xsd:string'),
1434  SERVICE_NAMESPACE,
1435  SERVICE_NAMESPACE . '#getProgressInfo',
1436  SERVICE_STYLE,
1437  SERVICE_USE,
1438  'Get object learning progress information'
1439  );
1440 
1441  $this->server->register(
1442  'exportDataCollectionContent',
1443  array(
1444  'sid' => 'xsd:string',
1445  'ref_id' => 'xsd:int',
1446  'table_id' => 'xsd:int',
1447  'format' => 'xsd:string',
1448  'filepath' => 'xsd:string'
1449  ),
1450  array('export_path' => 'xsd:string'),
1451  SERVICE_NAMESPACE,
1452  SERVICE_NAMESPACE . '#exportDataCollectionTableContent',
1453  SERVICE_STYLE,
1454  SERVICE_USE,
1455  'Generate DataCollectionContent Export'
1456  );
1457 
1458  $this->server->register(
1459  'processBackgroundTask',
1460  array(
1461  'sid' => 'xsd:string',
1462  'task_id' => 'xsd:int'
1463  ),
1464  array('status' => 'xsd:boolean'),
1465  SERVICE_NAMESPACE,
1466  SERVICE_NAMESPACE . '#processBackgroundTask',
1467  SERVICE_STYLE,
1468  SERVICE_USE,
1469  'Process task in background'
1470  );
1471 
1472  // OrgUnits Functions
1476  $f = [
1478  new EmployeePositionId(),
1479  new ImportOrgUnitTree(),
1480  new OrgUnitTree(),
1481  new PositionIds(),
1482  new PositionTitle(),
1484  new SuperiorPositionId(),
1485  new UserIdsOfPosition(),
1487  ];
1488 
1489  foreach ($f as $function) {
1490  $this->server->register(
1491  $function->getName(),
1492  $function->getInputParams(),
1493  $function->getOutputParams(),
1494  SERVICE_NAMESPACE,
1495  SERVICE_NAMESPACE . '#orgu',
1496  SERVICE_STYLE,
1497  SERVICE_USE,
1498  $function->getDocumentation()
1499  );
1500  }
1501 
1502  // If a client ID is submitted, there might be some SOAP plugins registering methods/types
1503  // no initialized ILIAS => no request wrapper available.
1504  if (isset($_GET['client_id'])) {
1505  $this->handleSoapPlugins();
1506  }
1507  }
1508 
1512  protected function handleSoapPlugins(): void
1513  {
1514  // Note: We need a context that does not handle authentication at this point, because this is
1515  // handled by an actual SOAP request which always contains the session ID and client
1519 
1520  global $DIC;
1521 
1522  $component_factory = $DIC['component.factory'];
1523  $soapHook = new ilSoapHook($component_factory);
1524  foreach ($soapHook->getWsdlTypes() as $type) {
1525  $this->server->wsdl->addComplexType(
1526  $type->getName(),
1527  $type->getTypeClass(),
1528  $type->getPhpType(),
1529  $type->getCompositor(),
1530  $type->getRestrictionBase(),
1531  $type->getElements(),
1532  $type->getAttributes(),
1533  $type->getArrayType()
1534  );
1535  }
1536  foreach ($soapHook->getSoapMethods() as $method) {
1537  $this->server->register(
1538  $method->getName(),
1539  $method->getInputParams(),
1540  $method->getOutputParams(),
1541  $method->getServiceNamespace(),
1542  $method->getServiceNamespace() . '#' . $method->getName(),
1543  $method->getServiceStyle(),
1544  $method->getServiceUse(),
1545  $method->getDocumentation()
1546  );
1547  }
1548  }
1549 }
Backward compatibility.
Definition: nusoap.php:4598
$_GET["client_id"]
Definition: webdav.php:30
exit
Definition: login.php:29
handleSoapPlugins()
Register any methods and types of SOAP plugins to the SOAP server.
const CONTEXT_SOAP_NO_AUTH
global $DIC
Definition: feed.php:28
static initILIAS()
ilias initialisation
Class ilSoapHook.
static init(string $a_type)
Init context by type.
const CONTEXT_SOAP
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...