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