steffen: server/perl-kolab/Kolab-LDAP LDAP.pm,1.40,1.41

cvs at intevation.de cvs at intevation.de
Tue Nov 29 02:44:50 CET 2005


Author: steffen

Update of /kolabrepository/server/perl-kolab/Kolab-LDAP
In directory doto:/tmp/cvs-serv24256/Kolab-LDAP

Modified Files:
	LDAP.pm 
Log Message:
Set ACL for group and resource accounts to calendar at mydomain has access

Index: LDAP.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab-LDAP/LDAP.pm,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- LDAP.pm	30 Sep 2005 21:02:15 -0000	1.40
+++ LDAP.pm	29 Nov 2005 01:44:48 -0000	1.41
@@ -27,6 +27,7 @@
 use UNIVERSAL;
 use Net::LDAP qw( LDAP_SUCCESS LDAP_PROTOCOL_ERROR LDAP_REFERRAL );
 use Net::LDAPS;
+use Net::LDAP::Util;
 use DB_File;
 use Kolab;
 use Kolab::Util;
@@ -315,6 +316,19 @@
 	    if( $p ne 'sf' && !$islocal ) {
 	      # Hide user mailboxes on other servers
 	      Kolab::Cyrus::setACL($cyrus,$uid,0, ["$uid rswipcda"]);
+	    } elsif( $p ne 'sf' ) {
+	      # Deal with group and resource accounts
+	      my $edn = Net::LDAP::Util::ldap_explode_dn($object->dn(), casefold=>'lower' );
+	      my $gcn = $edn->[1]->{'cn'};
+	      if( $gcn eq 'groups' || $gcn eq 'resources' ) {
+		# We need to give the calendar user access to 
+		# the groups/resources folder.
+		# TODO: Don't hardcode username
+		Kolab::log('L', "Detected group or resource account, adding ACL for calendar", KOLAB_ERROR );
+		Kolab::Cyrus::setACL($cyrus,$uid,0, ["$uid rswipcda", 
+						     'calendar@'.$Kolab::config{'postfix-mydomain'}
+						     .' rswipcda']);		
+	      }
 	    }
 #	    if( $p ne 'sf' ) {
 #	      # Create FB dir for user





More information about the commits mailing list