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