superedit-TEST_GET_ICAL_EVENTS.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?
  2. //require_once('superedit-SEF.php');
  3. //require_once('config/.config_biuro.biall-net.pl.php');
  4. //SEF('DEBUG_S');
  5. function TEST_GET_ICAL_EVENTS() {
  6. require_once('stuff/caldav-client.php');
  7. //$cal = new CalDAVClient( "https://biuro.biall-net.pl:8443/principals/users/a.binder/", "a.binder", "", "" );
  8. DEBUG_S(-3,'url',$_SESSION['CONFIG']['CALDAV_URL']);
  9. $cal = new CalDAVClient( $_SESSION['CONFIG']['CALDAV_URL']."/calendars/__uids__/4720124D-5F20-4EAB-B501-4872E33F9A5C/calendar/", $_SESSION['CONFIG']['CALDAV_USERNAME'], $_SESSION['CONFIG']['CALDAV_PASSWORD'], "" );
  10. $options = $cal->DoOptionsRequest();
  11. DEBUG_S(-3,'options',$options);
  12. // <C:getctag />
  13. $xmlC = <<<PROPP
  14. <?xml version="1.0" encoding="utf-8" ?>
  15. <D:propfind xmlns:D="DAV:" xmlns:C="http://calendarserver.org/ns/">
  16. <D:prop>
  17. <D:displayname />
  18. <D:resourcetype />
  19. <D:getetag />
  20. </D:prop>
  21. </D:propfind>
  22. PROPP;
  23. //if ( isset($options["PROPFIND"]) ) {
  24. // Fetch some information about the events in that calendar
  25. $cal->SetDepth(1);
  26. $folder_xml = $cal->DoXMLRequest("PROPFIND", $xmlC);
  27. DEBUG_S(-3,'folder_xml',$folder_xml,__FILE__,__FUNCTION__,__LINE__);
  28. // }
  29. if ( isset($options["PROPFIND"]) ) {
  30. // Fetch some information about the events in that calendar
  31. $cal->SetDepth(1);
  32. /*
  33. $folder_xml = $cal->DoXMLRequest("PROPFIND", '<?xml version="1.0" encoding="utf-8" ?><propfind xmlns="DAV:"><prop><getcontentlength/><getcontenttype/><resourcetype/><getetag/></prop></propfind>' );
  34. */
  35. }
  36. DEBUG_S(-3,'folder_xml',$folder_xml,__FILE__,__FUNCTION__,__LINE__);
  37. // $events = $cal->GetEvents("20130901T000000Z","20140101T000000Z");
  38. //DEBUG_S(-3,'events',$events);
  39. }
  40. ?>