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