steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusy.class.php, 1.17, 1.18 pfb.php, 1.6, 1.7

cvs at intevation.de cvs at intevation.de
Mon Nov 1 14:09:21 CET 2004


Author: steffen

Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv14977/kolab-resource-handlers/freebusy

Modified Files:
	freebusy.class.php pfb.php 
Log Message:
fix for issue496 (rfc2446 brokenness) + bugfixes

Index: freebusy.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.class.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- freebusy.class.php	31 Oct 2004 21:02:19 -0000	1.17
+++ freebusy.class.php	1 Nov 2004 13:09:19 -0000	1.18
@@ -92,10 +92,19 @@
     $vFb->setAttribute('DTSTAMP', time());
     $vFb->setAttribute('DTSTART', $startstamp);
     $vFb->setAttribute('DTEND', $endstamp);
-    $vFb->setAttribute('URL', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
+    // URL is not required, so out it goes...
+    //$vFb->setAttribute('URL', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
   
+    if( $this->imap->getNumberOfMessages() == 0 ) {
+      $vFb->setAttribute('DTSTART', 0, array(), false );
+      $vFb->setAttribute('DTEND', 0, array(), false );
+      $vFb->setAttribute('COMMENT', 'This is a dummy vfreebusy that indicates an empty calendar');
+      $vFb->addBusyPeriod( 'BUSY', 0,0, null );
+      $vCal->addComponent($vFb);
+      return array($vCal->exportvCalendar(),$vCal->exportvCalendar());
+    }
     $messages = $this->imap->getMessages();
-    if( PEAR::isError( $messages ) ) return $messages;
+    if( PEAR::isError( $messages ) ) return array( $messages, null);
     foreach ($messages as $textmsg) {
       $mimemsg = &MIME_Structure::parseTextMIMEMessage($textmsg);
     
@@ -108,12 +117,14 @@
 	  $part->transferDecodeContents();
 	  $event = $this->getEventHash($part->getContents());
 	  if ($event === false) {
+	    myLog("No x-vnd.kolab.event in ".$part->getContents(), RM_LOG_DEBUG);
 	    continue;
 	  }
 	}
       }
     
       if ($event === false) {
+	myLog("No x-vnd.kolab.events at all ", RM_LOG_DEBUG);
 	continue;
       }
       
@@ -132,7 +143,7 @@
     
       $summary = ($event['sensitivity'] == 'public' ? $event['summary'] : '');
     
-      //trigger_error("Looking at message with uid=$uid and summary=$summary", E_USER_NOTICE);
+      myLog("Looking at message with uid=$uid and summary=$summary", RM_LOG_DEBUG);
     
       // Get the events initial start
       $initial_start = $event['start-date'];
@@ -150,6 +161,7 @@
       }
 
       if( array_key_exists( 'recurrence', $event ) ) {	
+	myLog("Detected recurring event $uid", RM_LOG_DEBUG);
 	$rec = $event['recurrence'];
 	$recurrence =& new FreeBusyRecurrence( $vFb, $extra );
 	$recurrence->setStartDate( $initial_start );

Index: pfb.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/pfb.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pfb.php	21 Oct 2004 10:12:49 -0000	1.6
+++ pfb.php	1 Nov 2004 13:09:19 -0000	1.7
@@ -106,7 +106,7 @@
   list($vfb,$xvfb) = $fb->generateFreeBusy();
   $ts = mktime();
   if( PEAR::isError( $vfb ) ) {
-    unauthorized($rc->toString());
+    unauthorized($vfb->toString());
     return false;
   }
 





More information about the commits mailing list