ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilnetucateXMLAPI Class Reference

API to communicate with a the CMSAPI of centra (c) Sascha Hofmann, 2004. More...

+ Inheritance diagram for ilnetucateXMLAPI:
+ Collaboration diagram for ilnetucateXMLAPI:

Public Member Functions

 ilnetucateXMLAPI ()
 Constructor @access public. More...
 
 xmlFormatData ($a_data)
 Indents text for better reading. More...
 
 setServerAddr ($a_server_addr)
 
 getServerAddr ()
 
 getServerPort ()
 
 getServerTimeOut ()
 
 getServerPath ()
 
 getServerScheme ()
 
 getCustomerID ()
 
 setRequest ($a_data)
 
 sendRequest ($a_request='')
 
 addUserOLD (&$a_login_data, &$a_user_obj, $a_authority="leader")
 add user account to iLinc More...
 
 addUser (&$a_ilinc_user_obj, $a_authority="leader")
 add user account to iLinc More...
 
 editUser (&$a_ilinc_user_obj)
 change user account in iLinc More...
 
 registerUser ($a_ilinc_course_id, $a_ilinc_user_arr)
 
 findRegisteredUsersByRole ($a_ilinc_course_id, $a_instructorflag=false)
 
 unregisterUser ($a_ilinc_course_id, $a_ilinc_user_ids)
 
 findUser (&$a_id, &$a_login, &$a_fullname)
 
 removeUser (&$a_user_obj)
 
 addClass ($a_course_id, $a_data)
 
 editClass ($a_class_id, $a_data)
 
 joinClass (&$a_ilinc_user_obj, $a_ilinc_class_id)
 
 userLogin (&$a_ilinc_user_obj)
 
 uploadPicture (&$a_ilinc_user_obj)
 
 removeClass ($a_icla_id)
 
 findCourseClasses ($a_icrs_id)
 
 findClass ($a_class_id)
 
 addCourse (&$a_icrs_arr)
 
 editCourse ($a_icrs_id, $a_icrs_arr)
 
 removeCourse ($a_icrs_id)
 
- Public Member Functions inherited from ilXmlWriter
 ilXmlWriter ($version="1.0", $outEnc="utf-8", $inEnc="utf-8")
 constructor More...
 
 _ilXmlWriter ()
 destructor @access public More...
 
 xmlSetDtdDef ($dtdDef)
 Sets dtd definition. More...
 
 xmlSetStSheet ($stSheet)
 Sets stylesheet. More...
 
 xmlSetGenCmt ($genCmt)
 Sets generated comment. More...
 
 _xmlEscapeData ($data)
 Escapes reserved characters. More...
 
 xmlEncodeData ($data)
 Encodes text from input encoding into output encoding. More...
 
 xmlFormatData ($data)
 Indents text for better reading. More...
 
 xmlFormatElement ($array)
 Callback function for xmlFormatData; do not invoke directly. More...
 
 xmlHeader ()
 Writes xml header @access public. More...
 
 xmlStartTag ($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
 Writes a starttag. More...
 
 xmlEndTag ($tag)
 Writes an endtag. More...
 
 xmlComment ($comment)
 Writes a comment. More...
 
 xmlData ($data, $encode=TRUE, $escape=TRUE)
 Writes data. More...
 
 xmlElement ($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile ($file, $format=TRUE)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem ($format=TRUE)
 Returns xml document from memory. More...
 
 appendXML ($a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr @access public More...
 

Additional Inherited Members

- Data Fields inherited from ilXmlWriter
 $xmlStr
 
 $version
 
 $outEnc
 
 $inEnc
 
 $dtdDef = ""
 
 $stSheet = ""
 
 $genCmt = "Generated by ILIAS XmlWriter"
 

Detailed Description

API to communicate with a the CMSAPI of centra (c) Sascha Hofmann, 2004.

Author
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

Definition at line 15 of file class.ilnetucateXMLAPI.php.

Member Function Documentation

◆ addClass()

ilnetucateXMLAPI::addClass (   $a_course_id,
  $a_data 
)

Definition at line 448 of file class.ilnetucateXMLAPI.php.

449 {
450 $this->xmlClear();
451 $this->xmlHeader();
452
453 $this->xmlStartTag('netucate.API.Request');
454
455 $attr = array();
456 $attr['user'] = $this->reg_login;
457 $attr['password'] = $this->reg_passwd;
458 $attr['customerid'] = $this->customer_id;
459 $attr['id'] = "";
460 $attr['command'] = "Add";
461 $attr['object'] = "Class";
462 $this->xmlStartTag('netucate.Command',$attr);
463 $this->xmlEndTag('netucate.Command');
464
465 $attr = array();
466 $attr['courseid'] = $a_course_id;
467 $attr['name'] = $a_data['title'];
468 $attr['instructoruserid'] = $a_data['instructoruserid'];
469 $attr['description'] = $a_data['desc'];
470 $attr['alwaysopen'] = $a_data['alwaysopen'];
471 //$attr['password'] = $a_data['password'];
472 //$attr['bandwidth'] = $a_data['bandwidth'];
473 //$attr['appsharebandwidth'] = $a_data['appsharebandwidth'];
474 //$attr['message'] = $a_data['message'];
475 //$attr['floorpolicy'] = $a_data['floorpolicy'];
476 //$attr['conferencetypeid'] = $a_data['conferencetypeid'];
477 //$attr['videobandwidth'] = $a_data['videobandwidth'];
478 //$attr['videoframerate'] = $a_data['videoframerate'];
479 //$attr['enablepush'] = $a_data['enablepush'];
480 //$attr['issecure'] = $a_data['issecure'];
481
482 // only update akclassvalues if akclassvalues are enabled
483 if (array_key_exists('akclassvalue1',$a_data))
484 {
485 $attr['akclassvalue1'] = $a_data['akclassvalue1'];
486 }
487 if (array_key_exists('akclassvalue2',$a_data))
488 {
489 $attr['akclassvalue2'] = $a_data['akclassvalue2'];
490 }
491
492 $this->xmlStartTag('netucate.Class',$attr);
493 $this->xmlEndTag('netucate.Class');
494
495 $this->xmlEndTag('netucate.API.Request');
496
497 //var_dump($this->xmlDumpMem());exit;
498 }
xmlEndTag($tag)
Writes an endtag.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlClear()
clears xmlStr @access public
xmlHeader()
Writes xml header @access public.

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ addCourse()

ilnetucateXMLAPI::addCourse ( $a_icrs_arr)

Definition at line 690 of file class.ilnetucateXMLAPI.php.

691 {
692 $this->xmlClear();
693 $this->xmlHeader();
694
695 $this->xmlStartTag('netucate.API.Request');
696
697 $attr = array();
698 $attr['user'] = $this->reg_login;
699 $attr['password'] = $this->reg_passwd;
700 $attr['customerid'] = $this->customer_id;
701 $attr['id'] = "";
702 $attr['command'] = "Add";
703 $attr['object'] = "Course";
704 $this->xmlStartTag('netucate.Command',$attr);
705 $this->xmlEndTag('netucate.Command');
706
707 $attr = array();
708 $attr['name'] = $a_icrs_arr['title'];
709 $attr['homepage'] = $a_icrs_arr['homepage']; // (optional; if present and not empty, the value will be changed)
710 $attr['download'] = $a_icrs_arr['download']; // (optional; if present and not empty, the value will be changed)
711 $attr['description'] = $a_icrs_arr['desc']; // (optional; if present and not empty, the value will be changed)
712 $this->xmlStartTag('netucate.Course',$attr);
713 $this->xmlEndTag('netucate.Course');
714
715 $this->xmlEndTag('netucate.API.Request');
716 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ addUser()

ilnetucateXMLAPI::addUser ( $a_ilinc_user_obj,
  $a_authority = "leader" 
)

add user account to iLinc

Parameters
arraylogin data
stringuser fullname
stringpermission level (optional)

Definition at line 196 of file class.ilnetucateXMLAPI.php.

197 {
198 $this->xmlClear();
199 $this->xmlHeader();
200
201 $this->xmlStartTag('netucate.API.Request');
202
203 $attr = array();
204 $attr['user'] = $this->reg_login;
205 $attr['password'] = $this->reg_passwd;
206 $attr['customerid'] = $this->customer_id;
207 $attr['id'] = "";
208 $attr['command'] = "Add";
209 $attr['object'] = "User";
210 $this->xmlStartTag('netucate.Command',$attr);
211 $this->xmlEndTag('netucate.Command');
212
213 $attr = array();
214 $attr['loginname'] = $a_ilinc_user_obj->login; // required; max 64 chars
215 $attr['fullname'] = $a_ilinc_user_obj->user->getFullname($this->user_max_strlen); // required; max 32 chars
216 $attr['password'] = $a_ilinc_user_obj->passwd; // required; max 127 chars
217 $attr['authority'] = $a_authority; // optional; participant or leader, Default: leader
218 $attr['email'] = $a_ilinc_user_obj->user->getEmail(); // optional; max 64 chars
219 $attr['homepage'] = ""; // no standard in ILIAS; optional; max 255 chars
220 $attr['contactinfo'] = $a_ilinc_user_obj->user->getInstitution(); // optional; max 64 chars
221 $attr['comments'] = $a_ilinc_user_obj->user->getComment(); // no standard in ILIAS; optional; max 64 chars
222 $attr['phonenumber'] = $a_ilinc_user_obj->user->getPhoneOffice(); // optional; max 32 chars
223 $attr['akuservalue1'] = $a_ilinc_user_obj->akuservalue1; // optional; max 64 chars
224 $attr['akuservalue2'] = $a_ilinc_user_obj->akuservalue2; // optional; max 64 chars
225
226 $this->xmlStartTag('netucate.User',$attr);
227 $this->xmlEndTag('netucate.User');
228
229 $this->xmlEndTag('netucate.API.Request');
230 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ addUserOLD()

ilnetucateXMLAPI::addUserOLD ( $a_login_data,
$a_user_obj,
  $a_authority = "leader" 
)

add user account to iLinc

Parameters
arraylogin data
stringuser fullname
stringpermission level (optional)

Definition at line 152 of file class.ilnetucateXMLAPI.php.

153 {
154 $this->xmlClear();
155 $this->xmlHeader();
156
157 $this->xmlStartTag('netucate.API.Request');
158
159 $attr = array();
160 $attr['user'] = $this->reg_login;
161 $attr['password'] = $this->reg_passwd;
162 $attr['customerid'] = $this->customer_id;
163 $attr['id'] = "";
164 $attr['command'] = "Add";
165 $attr['object'] = "User";
166 $this->xmlStartTag('netucate.Command',$attr);
167 $this->xmlEndTag('netucate.Command');
168
169 $attr = array();
170 $attr['loginname'] = $a_login_data["login"]; // required; max 64 chars
171 $attr['fullname'] = $a_user_obj->getFullname($this->user_max_strlen); // required; max 32 chars
172 $attr['password'] = $a_login_data["passwd"]; // required; max 127 chars
173 $attr['authority'] = $a_authority; // optional; participant or leader, Default: leader
174 $attr['email'] = $a_user_obj->getEmail(); // optional; max 64 chars
175 $attr['homepage'] = ""; // no standard in ILIAS; optional; max 255 chars
176 $attr['contactinfo'] = $a_user_obj->getInstitution(); // optional; max 64 chars
177 $attr['comments'] = $a_user_obj->getComment(); // no standard in ILIAS; optional; max 64 chars
178 $attr['phonenumber'] = $a_user_obj->getPhoneOffice(); // optional; max 32 chars
179 $attr['akuservalue1'] = ""; // optional; max 64 chars
180 $attr['akuservalue2'] = ""; // optional; max 64 chars
181
182 $this->xmlStartTag('netucate.User',$attr);
183 $this->xmlEndTag('netucate.User');
184
185 $this->xmlEndTag('netucate.API.Request');
186 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ editClass()

ilnetucateXMLAPI::editClass (   $a_class_id,
  $a_data 
)

Definition at line 500 of file class.ilnetucateXMLAPI.php.

501 {
502 $this->xmlClear();
503 $this->xmlHeader();
504
505 $this->xmlStartTag('netucate.API.Request');
506
507 $attr = array();
508 $attr['user'] = $this->reg_login;
509 $attr['password'] = $this->reg_passwd;
510 $attr['customerid'] = $this->customer_id;
511 $attr['id'] = "";
512 $attr['command'] = "Edit";
513 $attr['object'] = "Class";
514 $this->xmlStartTag('netucate.Command',$attr);
515 $this->xmlEndTag('netucate.Command');
516
517 $attr = array();
518 $attr['classid'] = $a_class_id;
519 $attr['name'] = $a_data['name'];
520 $attr['instructoruserid'] = $a_data['instructoruserid'];
521 $attr['description'] = $a_data['description'];
522 $attr['alwaysopen'] = $a_data['alwaysopen'];
523 //$attr['password'] = $a_data['password'];
524 //$attr['message'] = $a_data['message'];
525 //$attr['appsharebandwidth'] = $a_data['appsharebandwidth'];
526 //$attr['bandwidth'] = $a_data['bandwidth'];
527 //$attr['floorpolicy'] = $a_data['floorpolicy'];
528 //$attr['conferencetypeid'] = $a_data['conferencetypeid'];
529 //$attr['videobandwidth'] = $a_data['videobandwidth'];
530 //$attr['videoframerate'] = $a_data['videoframerate'];
531 //$attr['enablepush'] = $a_data['enablepush'];
532 //$attr['issecure'] = $a_data['issecure'];
533
534 // only update akclassvalues if akclassvalues are enabled
535 if (array_key_exists('akclassvalue1',$a_data))
536 {
537 $attr['akclassvalue1'] = $a_data['akclassvalue1'];
538 }
539 if (array_key_exists('akclassvalue2',$a_data))
540 {
541 $attr['akclassvalue2'] = $a_data['akclassvalue2'];
542 }
543
544 $this->xmlStartTag('netucate.Class',$attr);
545 $this->xmlEndTag('netucate.Class');
546
547 $this->xmlEndTag('netucate.API.Request');
548
549 //var_dump($this->xmlDumpMem());exit;
550 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ editCourse()

ilnetucateXMLAPI::editCourse (   $a_icrs_id,
  $a_icrs_arr 
)

Definition at line 718 of file class.ilnetucateXMLAPI.php.

719 {
720 $this->xmlClear();
721 $this->xmlHeader();
722
723 $this->xmlStartTag('netucate.API.Request');
724
725 $attr = array();
726 $attr['user'] = $this->reg_login;
727 $attr['password'] = $this->reg_passwd;
728 $attr['customerid'] = $this->customer_id;
729 $attr['id'] = "";
730 $attr['command'] = "Edit";
731 $attr['object'] = "Course";
732 $this->xmlStartTag('netucate.Command',$attr);
733 $this->xmlEndTag('netucate.Command');
734
735 // Modifies any or all of the fields in a Course record. An empty parameter in an existing attribute (except the name) will cause the corresponding field to be cleared.
736 $attr = array();
737 $attr['courseid'] = $a_icrs_id; // (required; existing courseID)
738 $attr['name'] = $a_icrs_arr['title']; // (optional; if present and not empty, the value will be changed)
739 $attr['homepage'] = $a_icrs_arr['homepage']; // (optional; if present and not empty, the value will be changed)
740 $attr['download'] = $a_icrs_arr['download']; // (optional; if present and not empty, the value will be changed)
741 $attr['description'] = $a_icrs_arr['desc']; // (optional; if present and not empty, the value will be changed)
742 $this->xmlStartTag('netucate.Course',$attr);
743 $this->xmlEndTag('netucate.Course');
744
745 $this->xmlEndTag('netucate.API.Request');
746 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ editUser()

ilnetucateXMLAPI::editUser ( $a_ilinc_user_obj)

change user account in iLinc

Parameters
arraylogin data
stringuser fullname
stringpermission level (optional)

Definition at line 240 of file class.ilnetucateXMLAPI.php.

241 {
242 $this->xmlClear();
243 $this->xmlHeader();
244
245 $this->xmlStartTag('netucate.API.Request');
246
247 $attr = array();
248 $attr['user'] = $this->reg_login;
249 $attr['password'] = $this->reg_passwd;
250 $attr['customerid'] = $this->customer_id;
251 $attr['id'] = "";
252 $attr['command'] = "Edit";
253 $attr['object'] = "User";
254 $this->xmlStartTag('netucate.Command',$attr);
255 $this->xmlEndTag('netucate.Command');
256
257 $attr = array();
258 $attr['userid'] = $a_ilinc_user_obj->id; // required;
259 //$attr['loginname'] = $a_ilinc_user_obj->login; // required; max 64 chars
260 $attr['fullname'] = $a_ilinc_user_obj->user->getFullname($this->user_max_strlen); // required; max 32 chars
261 //$attr['password'] = $a_ilinc_user_obj->passwd; // required; max 127 chars
262 //$attr['authority'] = $a_authority; // optional; participant or leader, Default: leader
263 $attr['email'] = $a_ilinc_user_obj->user->getEmail(); // optional; max 64 chars
264 //$attr['homepage'] = ""; // no standard in ILIAS; optional; max 255 chars
265 $attr['contactinfo'] = $a_ilinc_user_obj->user->getInstitution(); // optional; max 64 chars
266 $attr['comments'] = $a_ilinc_user_obj->user->getComment(); // no standard in ILIAS; optional; max 64 chars
267 $attr['phonenumber'] = $a_ilinc_user_obj->user->getPhoneOffice(); // optional; max 32 chars
268 $attr['akuservalue1'] = $a_ilinc_user_obj->akuservalue1; // optional; max 64 chars
269 $attr['akuservalue2'] = $a_ilinc_user_obj->akuservalue2; // optional; max 64 chars
270
271 $this->xmlStartTag('netucate.User',$attr);
272 $this->xmlEndTag('netucate.User');
273
274 $this->xmlEndTag('netucate.API.Request');
275 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ findClass()

ilnetucateXMLAPI::findClass (   $a_class_id)

Definition at line 665 of file class.ilnetucateXMLAPI.php.

666 {
667 $this->xmlClear();
668 $this->xmlHeader();
669
670 $this->xmlStartTag('netucate.API.Request');
671
672 $attr = array();
673 $attr['user'] = $this->reg_login;
674 $attr['password'] = $this->reg_passwd;
675 $attr['customerid'] = $this->customer_id;
676 $attr['id'] = "";
677 $attr['command'] = "Find";
678 $attr['object'] = "Class";
679 $this->xmlStartTag('netucate.Command',$attr);
680 $this->xmlEndTag('netucate.Command');
681
682 $attr = array();
683 $attr['classid'] = $a_class_id;
684 $this->xmlStartTag('netucate.Class',$attr);
685 $this->xmlEndTag('netucate.Class');
686
687 $this->xmlEndTag('netucate.API.Request');
688 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ findCourseClasses()

ilnetucateXMLAPI::findCourseClasses (   $a_icrs_id)

Definition at line 640 of file class.ilnetucateXMLAPI.php.

641 {
642 $this->xmlClear();
643 $this->xmlHeader();
644
645 $this->xmlStartTag('netucate.API.Request');
646
647 $attr = array();
648 $attr['user'] = $this->reg_login;
649 $attr['password'] = $this->reg_passwd;
650 $attr['customerid'] = $this->customer_id;
651 $attr['id'] = "";
652 $attr['command'] = "Find";
653 $attr['object'] = "CourseClasses";
654 $this->xmlStartTag('netucate.Command',$attr);
655 $this->xmlEndTag('netucate.Command');
656
657 $attr = array();
658 $attr['courseid'] = $a_icrs_id;
659 $this->xmlStartTag('netucate.Course',$attr);
660 $this->xmlEndTag('netucate.Course');
661
662 $this->xmlEndTag('netucate.API.Request');
663 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ findRegisteredUsersByRole()

ilnetucateXMLAPI::findRegisteredUsersByRole (   $a_ilinc_course_id,
  $a_instructorflag = false 
)

Definition at line 317 of file class.ilnetucateXMLAPI.php.

318 {
319 $this->xmlClear();
320 $this->xmlHeader();
321
322 $this->xmlStartTag('netucate.API.Request');
323
324 $attr = array();
325 $attr['user'] = $this->reg_login;
326 $attr['password'] = $this->reg_passwd;
327 $attr['customerid'] = $this->customer_id;
328 $attr['id'] = "";
329 $attr['command'] = "Find";
330 $attr['object'] = "RegisteredUsersByRole";
331 $this->xmlStartTag('netucate.Command',$attr);
332 $this->xmlEndTag('netucate.Command');
333
334 $attr = array();
335 $attr['courseid'] = $a_ilinc_course_id;
336 $attr['instructorflag'] = ($a_instructorflag) ? "True" : "False";
337 $this->xmlStartTag('netucate.Course',$attr);
338
339 $this->xmlEndTag('netucate.Course');
340
341 $this->xmlEndTag('netucate.API.Request');
342 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ findUser()

ilnetucateXMLAPI::findUser ( $a_id,
$a_login,
$a_fullname 
)

Definition at line 383 of file class.ilnetucateXMLAPI.php.

384 {
385 $this->xmlClear();
386 $this->xmlHeader();
387
388 $this->xmlStartTag('netucate.API.Request');
389
390 $attr = array();
391 $attr['user'] = $this->reg_login;
392 $attr['password'] = $this->reg_passwd;
393 $attr['customerid'] = $this->customer_id;
394 $attr['id'] = "";
395 $attr['command'] = "Find";
396 $attr['object'] = "User";
397 $this->xmlStartTag('netucate.Command',$attr);
398 $this->xmlEndTag('netucate.Command');
399
400 $attr = array();
401 $attr['userid'] = $a_id;
402 $attr['loginname'] = $a_login;
403 $attr['fullname'] = $a_fullname;
404 $attr['lotnumber'] = "0"; // optional; The set of matching records to return. If 0, all matching records will be returned. If 1, matches 1-25 will be returned. If 2, matches 26-50 will be returned, etc.; Default: 0
405 $this->xmlStartTag('netucate.User',$attr);
406 $this->xmlEndTag('netucate.User');
407
408 $this->xmlEndTag('netucate.API.Request');
409 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ getCustomerID()

ilnetucateXMLAPI::getCustomerID ( )

Definition at line 80 of file class.ilnetucateXMLAPI.php.

81 {
82 return $this->customer_id;
83 }

◆ getServerAddr()

ilnetucateXMLAPI::getServerAddr ( )

Definition at line 55 of file class.ilnetucateXMLAPI.php.

56 {
57 return $this->server_addr;
58 }

◆ getServerPath()

ilnetucateXMLAPI::getServerPath ( )

Definition at line 70 of file class.ilnetucateXMLAPI.php.

71 {
72 return $this->server_path;
73 }

Referenced by sendRequest().

+ Here is the caller graph for this function:

◆ getServerPort()

ilnetucateXMLAPI::getServerPort ( )

Definition at line 60 of file class.ilnetucateXMLAPI.php.

61 {
62 return $this->server_port;
63 }

◆ getServerScheme()

ilnetucateXMLAPI::getServerScheme ( )

Definition at line 75 of file class.ilnetucateXMLAPI.php.

76 {
77 return $this->server_scheme;
78 }

Referenced by sendRequest().

+ Here is the caller graph for this function:

◆ getServerTimeOut()

ilnetucateXMLAPI::getServerTimeOut ( )

Definition at line 65 of file class.ilnetucateXMLAPI.php.

66 {
67 return $this->server_timeout;
68 }

◆ ilnetucateXMLAPI()

ilnetucateXMLAPI::ilnetucateXMLAPI ( )

Constructor @access public.

Definition at line 21 of file class.ilnetucateXMLAPI.php.

22 {
23 global $ilias;
24
25 define('ILINC_MEMBER_NOTSET','ilinc_notset');
26 define('ILINC_MEMBER_DOCENT','ilinc_docent');
27 define('ILINC_MEMBER_STUDENT','ilinc_student');
28
29 parent::ilXmlWriter();
30
31 $this->ilias =& $ilias;
32
33 $this->reg_login = $this->ilias->getSetting("ilinc_registrar_login");
34 $this->reg_passwd = $this->ilias->getSetting("ilinc_registrar_passwd");
35 $this->customer_id = $this->ilias->getSetting("ilinc_customer_id");
36 $this->server_scheme = $this->ilias->getSetting("ilinc_protocol");
37 $this->server_addr = $this->ilias->getSetting("ilinc_server");
38 $this->server_path = $this->ilias->getSetting("ilinc_path");
39 $this->server_port = $this->ilias->getSetting("ilinc_port");
40 $this->server_timeout = $this->ilias->getSetting("ilinc_timeout");
41 $this->user_max_strlen = 32; // Max string length of full username (title + firstname + lastname)
42
43 }
redirection script todo: (a better solution should control the processing via a xml file)

◆ joinClass()

ilnetucateXMLAPI::joinClass ( $a_ilinc_user_obj,
  $a_ilinc_class_id 
)

Definition at line 552 of file class.ilnetucateXMLAPI.php.

553 {
554 $this->xmlClear();
555 $this->xmlHeader();
556
557 $this->xmlStartTag('netucate.API.Request');
558
559 $attr = array();
560 $attr['user'] = $a_ilinc_user_obj->login;
561 $attr['password'] = $a_ilinc_user_obj->passwd;
562 $attr['customerid'] = $this->customer_id;
563 $attr['id'] = "";
564 $attr['task'] = "JoinClass";
565 $attr['classid'] = $a_ilinc_class_id;
566 $this->xmlStartTag('netucate.Task',$attr);
567 $this->xmlEndTag('netucate.Task');
568
569 $this->xmlEndTag('netucate.API.Request');
570 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ registerUser()

ilnetucateXMLAPI::registerUser (   $a_ilinc_course_id,
  $a_ilinc_user_arr 
)

Definition at line 277 of file class.ilnetucateXMLAPI.php.

278 {
279 $this->xmlClear();
280 $this->xmlHeader();
281
282 $this->xmlStartTag('netucate.API.Request');
283
284 $attr = array();
285 $attr['user'] = $this->reg_login;
286 $attr['password'] = $this->reg_passwd;
287 $attr['customerid'] = $this->customer_id;
288 $attr['id'] = "";
289 $attr['command'] = "Register";
290 $attr['object'] = "User";
291 $this->xmlStartTag('netucate.Command',$attr);
292 $this->xmlEndTag('netucate.Command');
293
294 $attr = array();
295 $attr['courseid'] = $a_ilinc_course_id;
296 $this->xmlStartTag('netucate.Course',$attr);
297
298 $this->xmlStartTag('netucate.User.List');
299
300 foreach ($a_ilinc_user_arr as $user)
301 {
302 $attr = array();
303 $attr['userid'] = $user['id'];
304 $attr['instructorflag'] = $user['instructor'];
305 $this->xmlStartTag('netucate.User',$attr);
306 $this->xmlEndTag('netucate.User');
307 }
308
309 $this->xmlEndTag('netucate.User.List');
310
311 $this->xmlEndTag('netucate.Course');
312
313 $this->xmlEndTag('netucate.API.Request');
314 //var_dump($a_ilinc_user_arr,$this->xmlDumpMem());exit;
315 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ removeClass()

ilnetucateXMLAPI::removeClass (   $a_icla_id)

Definition at line 611 of file class.ilnetucateXMLAPI.php.

612 {
613 $this->xmlClear();
614 $this->xmlHeader();
615
616 $this->xmlStartTag('netucate.API.Request');
617
618 $attr = array();
619 $attr['user'] = $this->reg_login;
620 $attr['password'] = $this->reg_passwd;
621 $attr['customerid'] = $this->customer_id;
622 $attr['id'] = "";
623 $attr['command'] = "Remove";
624 $attr['object'] = "Class";
625 $this->xmlStartTag('netucate.Command',$attr);
626 $this->xmlEndTag('netucate.Command');
627
628 $this->xmlStartTag('netucate.Class.List');
629
630 $attr = array();
631 $attr['classid'] = $a_icla_id;
632 $this->xmlStartTag('netucate.Class',$attr);
633 $this->xmlEndTag('netucate.Class');
634
635 $this->xmlEndTag('netucate.Class.List');
636
637 $this->xmlEndTag('netucate.API.Request');
638 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ removeCourse()

ilnetucateXMLAPI::removeCourse (   $a_icrs_id)

Definition at line 748 of file class.ilnetucateXMLAPI.php.

749 {
750 $this->xmlClear();
751 $this->xmlHeader();
752
753 $this->xmlStartTag('netucate.API.Request');
754
755 $attr = array();
756 $attr['user'] = $this->reg_login;
757 $attr['password'] = $this->reg_passwd;
758 $attr['customerid'] = $this->customer_id;
759 $attr['id'] = "";
760 $attr['command'] = "Remove";
761 $attr['object'] = "Course";
762 $this->xmlStartTag('netucate.Command',$attr);
763 $this->xmlEndTag('netucate.Command');
764
765 $this->xmlStartTag('netucate.Course.List');
766
767 $attr = array();
768 $attr['courseid'] = $a_icrs_id;
769 $this->xmlStartTag('netucate.Class',$attr);
770 $this->xmlEndTag('netucate.Class');
771
772 /*
773 $attr = array();
774 $attr['courseid'] = "2191";
775 $this->xmlStartTag('netucate.Course',$attr);
776 $this->xmlEndTag('netucate.Course');
777 */
778
779 $this->xmlEndTag('netucate.Course.List');
780
781 $this->xmlEndTag('netucate.API.Request');
782 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ removeUser()

ilnetucateXMLAPI::removeUser ( $a_user_obj)

Definition at line 412 of file class.ilnetucateXMLAPI.php.

413 {
414 $this->xmlClear();
415 $this->xmlHeader();
416
417 $this->xmlStartTag('netucate.API.Request');
418
419 $attr = array();
420 $attr['user'] = $this->reg_login;
421 $attr['password'] = $this->reg_passwd;
422 $attr['customerid'] = $this->customer_id;
423 $attr['id'] = "";
424 $attr['command'] = "Remove";
425 $attr['object'] = "User";
426 $this->xmlStartTag('netucate.Command',$attr);
427 $this->xmlEndTag('netucate.Command');
428
429 $this->xmlStartTag('netucate.User.List');
430
431 $attr = array();
432 $attr['userid'] = "2191";
433 $attr['instructorflag'] = "True";
434 $this->xmlStartTag('netucate.User',$attr);
435 $this->xmlEndTag('netucate.User');
436
437 $attr = array();
438 $attr['userid'] = "2192";
439 $attr['loginname'] = "ffuss";
440 $this->xmlStartTag('netucate.User',$attr); // userid or loginname per User are required.
441 $this->xmlEndTag('netucate.User');
442
443 $this->xmlEndTag('netucate.User.List');
444
445 $this->xmlEndTag('netucate.API.Request');
446 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ sendRequest()

ilnetucateXMLAPI::sendRequest (   $a_request = '')

Definition at line 92 of file class.ilnetucateXMLAPI.php.

93 {
94 global $ilErr,$lng;
95
96 // get request xml data
97 $this->request = $this->xmlDumpMem();
98
99 // compose request header
100 $header = "Host: ".$this->getServerAddr()."\r\n";
101 $header .= "User-Agent: ILIAS open source\r\n";
102 $header .= "Content-Type: text/xml\r\n";
103 $header .= "Content-Length: ".strlen($this->request)."\r\n";
104 $header .= "Connection: close\r\n\r\n";
105
106 // determine protocol
107 if ($this->getServerScheme() == "https")
108 {
109 $scheme = "ssl";
110 }
111 else
112 {
113 $scheme = "http";
114 }
115
116 // open socket connection to server
117 $sock = @fsockopen($scheme."://".$this->getServerAddr(), $this->getServerPort(), $errno, $errstr, $this->getServerTimeOut());
118
119 if (!$sock)
120 {
121 $ilErr->raiseError($lng->txt('ilinc_connection_error'),$ilErr->MESSAGE);
122 }
123
124 // send request
125 fputs($sock, "POST ".$this->getServerPath()." HTTP/1.0\r\n");
126 fputs($sock,$header.$this->request);
127
128 $response = "";
129
130 // read response data and surpress error from buggy IIS software (missing 'close_notify' cause fatal error)
131 while (!feof($sock))
132 {
133 $response .= @fgets($sock, 128);
134 }
135
136 fclose($sock);
137
138 // return netucate response object
139 $response_obj = new ilnetucateResponse($response);
140
141 return $response_obj;
142 }
xmlDumpMem($format=TRUE)
Returns xml document from memory.
process reponse from Centra Server (c) Sascha Hofmann, 2004
global $lng
Definition: privfeed.php:40

References $ilErr, $lng, getServerPath(), getServerScheme(), and ilXmlWriter\xmlDumpMem().

+ Here is the call graph for this function:

◆ setRequest()

ilnetucateXMLAPI::setRequest (   $a_data)

Definition at line 85 of file class.ilnetucateXMLAPI.php.

86 {
87 $this->request = $a_data;
88 }

◆ setServerAddr()

ilnetucateXMLAPI::setServerAddr (   $a_server_addr)

Definition at line 50 of file class.ilnetucateXMLAPI.php.

51 {
52 $this->server_addr = $a_server_addr;
53 }

◆ unregisterUser()

ilnetucateXMLAPI::unregisterUser (   $a_ilinc_course_id,
  $a_ilinc_user_ids 
)

Definition at line 344 of file class.ilnetucateXMLAPI.php.

345 {
346 $this->xmlClear();
347 $this->xmlHeader();
348
349 $this->xmlStartTag('netucate.API.Request');
350
351 $attr = array();
352 $attr['user'] = $this->reg_login;
353 $attr['password'] = $this->reg_passwd;
354 $attr['customerid'] = $this->customer_id;
355 $attr['id'] = "";
356 $attr['command'] = "UnRegister";
357 $attr['object'] = "User";
358 $this->xmlStartTag('netucate.Command',$attr);
359 $this->xmlEndTag('netucate.Command');
360
361 $attr = array();
362 $attr['courseid'] = $a_ilinc_course_id;
363 $this->xmlStartTag('netucate.Course',$attr);
364
365 $this->xmlStartTag('netucate.User.List');
366
367 foreach ($a_ilinc_user_ids as $user_id)
368 {
369 $attr = array();
370 $attr['userid'] = $user_id;
371 $this->xmlStartTag('netucate.User',$attr);
372 $this->xmlEndTag('netucate.User');
373 }
374
375 $this->xmlEndTag('netucate.User.List');
376
377 $this->xmlEndTag('netucate.Course');
378
379 $this->xmlEndTag('netucate.API.Request');
380 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ uploadPicture()

ilnetucateXMLAPI::uploadPicture ( $a_ilinc_user_obj)

Definition at line 592 of file class.ilnetucateXMLAPI.php.

593 {
594 $this->xmlHeader();
595
596 $this->xmlStartTag('netucate.API.Request');
597
598 $attr = array();
599 $attr['user'] = $a_ilinc_user_obj->login;
600 $attr['password'] = $a_ilinc_user_obj->passwd;
601 $attr['customerid'] = $this->customer_id;
602 $attr['id'] = "";
603 $attr['locale'] = $a_ilinc_user_obj->user->getLanguage();
604 $attr['task'] = "UploadPicture";
605 $this->xmlStartTag('netucate.Task',$attr);
606 $this->xmlEndTag('netucate.Task');
607
608 $this->xmlEndTag('netucate.API.Request');
609 }

References ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ userLogin()

ilnetucateXMLAPI::userLogin ( $a_ilinc_user_obj)

Definition at line 572 of file class.ilnetucateXMLAPI.php.

573 {
574 $this->xmlClear();
575 $this->xmlHeader();
576
577 $this->xmlStartTag('netucate.API.Request');
578
579 $attr = array();
580 $attr['user'] = $a_ilinc_user_obj->login;
581 $attr['password'] = $a_ilinc_user_obj->passwd;
582 $attr['customerid'] = $this->customer_id;
583 $attr['id'] = "";
584 $attr['locale'] = $a_ilinc_user_obj->user->getLanguage();
585 $attr['task'] = "UserLogin";
586 $this->xmlStartTag('netucate.Task',$attr);
587 $this->xmlEndTag('netucate.Task');
588
589 $this->xmlEndTag('netucate.API.Request');
590 }

References ilXmlWriter\xmlClear(), ilXmlWriter\xmlEndTag(), ilXmlWriter\xmlHeader(), and ilXmlWriter\xmlStartTag().

+ Here is the call graph for this function:

◆ xmlFormatData()

ilnetucateXMLAPI::xmlFormatData (   $data)

Indents text for better reading.

Parameters
stringinput text
Returns
string indented text @access private

Reimplemented from ilXmlWriter.

Definition at line 45 of file class.ilnetucateXMLAPI.php.

46 {
47 return $a_data;
48 }

The documentation for this class was generated from the following file: