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