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