steffen: server/kolab-resource-handlers/kolab-resource-handlers/resmgr resmgr.php, 1.16, 1.17

cvs at intevation.de cvs at intevation.de
Thu Sep 9 15:03:18 CEST 2004


Author: steffen

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

Modified Files:
	resmgr.php 
Log Message:
make passthru work

Index: resmgr.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/resmgr.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- resmgr.php	9 Sep 2004 01:09:39 -0000	1.16
+++ resmgr.php	9 Sep 2004 13:03:16 -0000	1.17
@@ -1,5 +1,4 @@
 #!/kolab/bin/php
-
 <?php
 
 // What myLog levels we can use
@@ -185,11 +184,6 @@
 
     myLog('Starting up in ' . ($params['group'] ? 'group' : 'resource') . ' mode', RM_LOG_SUPER);
 
-    if (!$params['group'] && ($params['action'] == RM_ACT_MANUAL_IF_CONFLICTS || $params['action'] == RM_ACT_MANUAL_IF_CONFLICTS)) {
-        myLog("Invalid combination of 'group' and 'action' configuration variables", RM_LOG_DEBUG);
-        shutdown();
-    }
-
     $url_fopen = ini_get('allow_url_fopen');
     if (!$url_fopen) {
         myLog('\'allow_url_fopen\' is disabled in php.ini, enabling...', RM_LOG_WARN);
@@ -212,7 +206,7 @@
 }
 
 /**
- * Look up encrypted password from LDAP and decrypt it
+ * Look up action and encrypted password from LDAP and decrypt it
  */
 function getLDAPData()
 {
@@ -610,18 +604,19 @@
     // Get our mailbox strings for use in the imap_X functions
     $server = '{' . $params['server'] . '/imap/notls/novalidate-cert}';
     if ($inbox) {
-        $mailbox = "user/$prefix$suffix";
+        $mymailbox = "user/$prefix$suffix";
     } else {
-        $mailbox = "user/$prefix/" . $params['calendar_store'] . "$suffix";
+        $mymailbox = "user/$prefix/" . $params['calendar_store'] . "$suffix";
     }
     //$mailbox = "INBOX/Calendar";
-    $fullmbox = $server . $mailbox;
+    $fullmbox = $server . $mymailbox;
 
-    myLog("Opening connection to $server for " . $params['calendar_user'], RM_LOG_DEBUG);
+    myLog("Opening connection to $fullmbox for " . $params['calendar_user'], RM_LOG_DEBUG);
     // Open an IMAP connection to the requested users' calendar
     $imap = @imap_open($fullmbox, $params['calendar_user'], $params['calendar_pass'], OP_HALFOPEN);
     testIMAPError();
 
+    myLog( "Reopening $fullmbox", RM_LOG_DEBUG );
     @imap_reopen($imap, $fullmbox, CL_EXPUNGE);
     $errors = imap_errors();
     if (count($errors)) {
@@ -647,8 +642,8 @@
     global $imap, $server, $mailbox, $fullmbox, $prefix, $suffix, $connected;
 
     // Get our mailbox strings for use in the imap_X functions
-    $mailbox = "user/$prefix/$mailbox$suffix";
-    $fullmbox = $server . $mailbox;
+    $mymailbox = "user/$prefix/$mailbox$suffix";
+    $fullmbox = $server . $mymailbox;
 
     myLog("Repening connection to $fullmbox ($server)", RM_LOG_DEBUG);
 
@@ -728,7 +723,7 @@
 
 
 
-$options = getopt("s:r:gm:");
+$options = getopt("s:r:g");
 
 if (!array_key_exists('r', $options)) {
     print("Usage is $argv[0] -s sender at domain -r resource at domain [-g] [-m mode]");
@@ -738,9 +733,11 @@
 $params['group'] = array_key_exists('g', $options);
 $resource = $options['r'];
 $sender = $options['s'];
-
 init();
 
+// Make Horde happy
+$conf['server']['name'] = $params['email_domain'];
+
 // Set some parameters
 $params['calendar_user'] = $resource;
 $params['calendar_uid'] = getResourceUid();
@@ -957,20 +954,9 @@
         }
 }
 
-if (!$params['group']) {
-    myLog("!!!BUG!!! PASSING THROUGH $method METHOD TO A RESOURCE", RM_LOG_ERROR);
-    shutdown();
-}
-
 // Pass the message through to the group's mailbox
 myLog("Passing through $method method to $resource");
-if ($connected) {
-    imapReopen();
-} else {
-    imapConnect(true);
-}
-imapAppend($requestText);
-
+send_lmtp(  $sender, $resource, $requestText );
 shutdown(0);
 
 ?>





More information about the commits mailing list