steffen: server/kolab-resource-handlers/kolab-resource-handlers/resmgr resmgr.php, 1.71, 1.72

cvs at intevation.de cvs at intevation.de
Tue Nov 29 04:08:13 CET 2005


Author: steffen

Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr
In directory doto:/tmp/cvs-serv26667/kolab-resource-handlers/kolab-resource-handlers/resmgr

Modified Files:
	resmgr.php 
Log Message:
Work around braindead cyrus errormessages

Index: resmgr.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/resmgr.php,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- resmgr.php	29 Nov 2005 01:51:06 -0000	1.71
+++ resmgr.php	29 Nov 2005 03:08:11 -0000	1.72
@@ -33,6 +33,7 @@
 define('RM_ITIP_TENTATIVE',                 3);
 
 require_once 'Net/IMAP.php';
+require_once 'Horde/Auth.php';
 require_once 'Horde/iCalendar.php';
 require_once 'Horde/NLS.php';
 require_once 'Horde/MIME.php';
@@ -668,8 +669,13 @@
       if( !in_array( $calmbox, $mailboxes ) ) {
 	// Create mailbox
 	$rc = $imap->createMailBox( $calmbox );
-	if( PEAR::isError($rc) ) {
-	  myLog('IMAP Errors from createMailBox: ' . $rc->getMessage(), RM_LOG_ERROR );
+	if( PEAR::isError($rc) && PEAR::isError( $imap->selectMailBox($calmbox) ) ) {
+	  /* Notice that in case of an error, we check if
+	     we can select the mailbox. This is to test
+	     if CREATE failed because the mailbox already
+	     exists (but had the wrong annotation)
+	  */
+	  myLog("IMAP Errors from createMailBox( $calmbox ): " . $rc->getMessage(), RM_LOG_ERROR );
 	  return false;
 	}
       }





More information about the commits mailing list