steffen: server/kolab-resource-handlers/kolab-resource-handlers/resmgr resmgr.php, 1.25, 1.26

cvs at intevation.de cvs at intevation.de
Thu Sep 30 01:04:11 CEST 2004


Author: steffen

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

Modified Files:
	resmgr.php 
Log Message:
adapt to new fb urls

Index: resmgr.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/resmgr.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- resmgr.php	28 Sep 2004 22:46:22 -0000	1.25
+++ resmgr.php	29 Sep 2004 23:04:09 -0000	1.26
@@ -144,7 +144,7 @@
 
     // Get the resource's free/busy list
     // once more so it is up to date
-    if( !getFreeBusy(true) ) {
+    if( !triggerFreeBusy(false) ) {
       myLog("Error updating fblist", RM_LOG_SUPER );
     }
 
@@ -482,11 +482,21 @@
     return $uri;
 }
 
-function &getFreeBusy($cache = false)
+function &getFreeBusy() {
+  global $params;
+  return internalGetFreeBusy( $params['freebusy_url']);
+}
+
+function &triggerFreeBusy() {
+  global $params;
+  return internalGetFreeBusy( $params['pfb_trigger_url']);  
+}
+
+function &internalGetFreeBusy($url)
 {
     global $resource, $params, $ignore;
 
-    $url = str_replace('${USER}', urlencode($resource), $params['freebusy_url']);
+    $url = str_replace('${USER}', urlencode($resource), $url);
     if (!$cache) {
         // We're not caching, so ignore any events with the specified UIDs. This
         // is done to ignore events that are being updated, without actually
@@ -496,8 +506,8 @@
             $url .= '&i[]=' . urlencode($uid);
         }
     }
-    $url .= '&c=' . ($cache ? '1' : '0');
-    myLog("Using f/b URL $url", RM_LOG_DEBUG);
+    //$url .= '&c=' . ($cache ? '1' : '0');
+    //myLog("Using f/b URL $url", RM_LOG_DEBUG);
 
     $parsed = parse_url($url);
     $parsed['user'] = $params['calendar_uid'];
@@ -843,14 +853,13 @@
 
 
 
-$options = getopt("s:r:g");
+$options = getopt("s:r:");
 
 if (!array_key_exists('r', $options)) {
-    print("Usage is $argv[0] -s sender at domain -r resource at domain [-g] [-m mode]\n");
+    print("Usage is $argv[0] -s sender at domain -r resource at domain\n");
     shutdown(1);
 }
 
-$params['group'] = array_key_exists('g', $options);
 $resource = strtolower($options['r']);
 $sender = strtolower($options['s']);
 init();
@@ -866,12 +875,8 @@
 $params['action'] = $ldapdata['action'];
 myLog("Action for $sender is ".$params['action'], RM_LOG_DEBUG);
 if( !$params['action'] ) {
-    // Use defaults
-    if( $params['group'] ) {
-        $params['action'] = RM_ACT_MANUAL_IF_CONFLICTS;
-    } else {
-        $params['action'] = RM_ACT_REJECT_IF_CONFLICTS;
-    }
+  // Manual is the only safe default!
+  $params['action'] = RM_ACT_MANUAL;
 }
 
 require_once HORDE_BASE . '/lib/core.php';
@@ -965,6 +970,7 @@
         // is specified
         if ($params['action'] != RM_ACT_ALWAYS_ACCEPT) {
             // Get the resource's free/busy list
+	    triggerFreeBusy();
             $vfb = &getFreeBusy();
 
             if (!$vfb) {





More information about the commits mailing list