steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusy.class.php, 1.2, 1.3 freebusy.php, 1.31, 1.32 freebusycache.class.php, 1.3, 1.4
cvs at intevation.de
cvs at intevation.de
Wed Oct 13 16:17:08 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv21366/kolab-resource-handlers/kolab-resource-handlers/freebusy
Modified Files:
freebusy.class.php freebusy.php freebusycache.class.php
Log Message:
xfb fixes
Index: freebusy.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- freebusy.class.php 4 Oct 2004 09:31:18 -0000 1.2
+++ freebusy.class.php 13 Oct 2004 14:17:06 -0000 1.3
@@ -96,8 +96,8 @@
continue;
}
- /*
$uid = $event['uid'];
+ /*
// See if we need to ignore this event
if (isset($params['ignore'][$uid])) {
trigger_error("Ignoring event with uid=$uid", E_USER_NOTICE);
Index: freebusy.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- freebusy.php 12 Oct 2004 01:28:32 -0000 1.31
+++ freebusy.php 13 Oct 2004 14:17:06 -0000 1.32
@@ -12,8 +12,10 @@
$imapuser = $_SERVER['PHP_AUTH_USER'];
$imappw = $_SERVER['PHP_AUTH_PW'];
$req_cache = (bool)$_REQUEST['cache'];
-//$req_folder = $_REQUEST['folder'];
-$req_extended = (defined( $_REQUEST['extended'] ) && $_REQUEST['extended']);
+$req_extended = (bool)$_REQUEST['extended'];
+
+myLog("---FreeBusy Script starting (".$_SERVER['REQUEST_URI'].")---", RM_LOG_DEBUG );
+myLog("user=$user, imapuser=$imapuser, req_cache=$req_cache, req_extended=$req_extended", RM_LOG_DEBUG );
$ldap =& new FreeBusyLDAP( $params['ldap_uri'], $params['base_dn'] );
if( !$ldap->bind( $params['bind_dn'], $params['bind_pw'] ) ) {
@@ -66,10 +68,16 @@
foreach( $pfbs as $pfb ) {
$fb = $cache->load( $pfb, $ts2, $acl );
- if( $req_extended && !$cache->checkAcl( $acl, $imapuser, $imappw ) ) {
- $fb->extended = false; // HACK!
- $fb = $cache->load( $pfb, $ts2, $acl );
- $fb->extended = true;
+ if( $fb ) myLog("Found fb for $pfb", RM_LOG_DEBUG);
+ else myLog("No fb found for $pfb", RM_LOG_DEBUG);
+ if( $req_extended ) {
+ $r = $cache->getRights( $acl, $imapuser, $imapgroups );
+ if( !$fb || !array_key_exists( 'r', $r ) ) {
+ $cache->extended = false; // HACK!
+ $fb = $cache->load( $pfb, $ts2, $acl );
+ $cache->extended = true;
+ myLog("Falling back to non-extended fb", RM_LOG_DEBUG );
+ }
}
$ts = max( $ts, $ts2 );
if( $fb ) $collector->addFreebusy( $fb );
Index: freebusycache.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusycache.class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- freebusycache.class.php 5 Oct 2004 09:13:41 -0000 1.3
+++ freebusycache.class.php 13 Oct 2004 14:17:06 -0000 1.4
@@ -175,8 +175,10 @@
return $deleteduids;
}
+ /** Returns an array with cyrus permission chars (lrsp...) as keys */
function getRights( $acl, $uid, $groups ) {
- $uids = $groups;
+ if( is_array( $groups ) ) $uids = $groups;
+ else $uids = array();
for( $i = 0; $i < count($uids); $i++ ) $uids[$i] = 'group:'.$uids[$i];
$uids[] = $uid;
$rights = array();
More information about the commits
mailing list