martin: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusy.conf, 1.1.1.1, 1.2 freebusycache.class.php, 1.16, 1.17

cvs at intevation.de cvs at intevation.de
Fri Feb 3 08:05:13 CET 2006


Author: martin

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

Modified Files:
	freebusy.conf freebusycache.class.php 
Log Message:
Martin Konold: Make database type configurable but leave the default gdbm


Index: freebusy.conf
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.conf,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- freebusy.conf	11 Jun 2004 10:52:23 -0000	1.1.1.1
+++ freebusy.conf	3 Feb 2006 07:05:11 -0000	1.2
@@ -62,3 +62,6 @@
 // Should we send a Content-Disposition header, indicating what the name of the
 // resulting VFB file should be?
 $params['send_content_disposition'] = false;
+
+// What db type to use for freebusy caches 
+$params['dbtype'] = 'gdbm';

Index: freebusycache.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusycache.class.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- freebusycache.class.php	1 Jul 2005 11:55:48 -0000	1.16
+++ freebusycache.class.php	3 Feb 2006 07:05:11 -0000	1.17
@@ -20,6 +20,10 @@
 
 /*! To load/store partial freebusy lists
     and their ACLs */
+    
+require_once('freebusy/misc.php');
+require_once('@resmgr_confdir@/freebusy.conf');
+
 class FreeBusyCache {
   function FreeBusyCache( $basedir, $extended = false ) {
     $this->basedir = $basedir;
@@ -27,6 +31,7 @@
   }
 
   function store( $filename, $fbdata, $acl, $relevance ) {
+    global $params;
     if( ereg( '\.\.', $filename ) ) {
       $this->error = $filename._(' is not absolute');
       return false;
@@ -40,7 +45,7 @@
       // false data means delete the pfb
       unlink($fbfilename);
       $oldacl = $this->loadACL( $filename );
-      $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', 'gdbm' );
+      $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', $params['dbtype'] );
       if( $db === false ) return false;
       foreach( $oldacl as $ac ) {
 	  if( dba_exists( $ac['USER'], $db ) ) {
@@ -87,7 +92,7 @@
       default: $perm = 'a';
       }
 
-      $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', 'gdbm' );
+      $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', $params['dbtype'] );
       if( $db === false ) {
 	myLog('Unable to open freebusy cache db '.$this->basedir.'/pfbcache.db',
 	      RM_LOG_ERROR );
@@ -136,10 +141,11 @@
   }
 
   function delete( $filename ) {
+    global $params;
     $fbfilename = $this->mkfbfilename($filename);
     unlink($fbfilename);
     unlink($this->mkaclfilename($filename));    
-    $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', 'gdbm' );
+    $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', $params['dbtype'] );
     if( $db === false ) return false;
     for( $uid = dba_firstkey($db); $uid !== false; $uid = dba_nextkey($db)) {
       $lst = dba_fetch( $uid, $db );
@@ -152,8 +158,9 @@
   }
 
   function findAll( $uid, $groups ) {
+    global $params;
     $lst = array();
-    $db = dba_open( $this->basedir.'/pfbcache.db', 'cd', 'gdbm' );
+    $db = dba_open( $this->basedir.'/pfbcache.db', 'rd', $params['dbtype'] );
     if( $db === false ) return false;
     $uids = $groups;
     for( $i = 0; $i < count($uids); $i++ ) $uids[$i] = 'group:'.$uids[$i];





More information about the commits mailing list