[Kolab-devel] [PATCH] types for shared folders

Tobias Koenig tokoe at kde.org
Tue Mar 21 18:32:26 CET 2006


Hi,

the attached patches add support to specify the type of a shared folder
in LDAP. This needs an extension to the LDAP schema however.
Any chance to get this patches upstream?

I'll provide a patch for the webfrontend as well, later.

Ciao,
Tobias
-- 
Separate politics from religion and economy!
The Councile of the European Union is an undemocratic and illegal institution!
-------------- next part --------------
--- ../Cyrus.pm.orig	2006-03-18 22:35:09.000000000 +0100
+++ ../Cyrus.pm	2006-03-18 22:34:13.000000000 +0100
@@ -183,6 +186,19 @@ sub setACL
     Kolab::log('Y', "Finished modifying ACL of $cyruid", KOLAB_DEBUG);
 }
 
+sub setFolderType
+{
+    my $cyrus = shift;
+    my $uid = shift;
+    my $sf = shift || 0;
+    my $foldertype = shift || 'mail';
+    my $cyruid = &createUid($uid, $sf);
+    
+    if (!$cyrus->mboxconfig($cyruid, '/vendor/kolab/folder-type', $foldertype)) {
+    	Kolab::log('Y', "Unable to set the folder type for mailbox `$cyruid' to `$foldertype', Error = `" . $cyrus->error . "'", KOLAB_WARN);
+    }
+}
+
 1;
 __END__
 # Below is stub documentation for your module. You'd better edit it!
-------------- next part --------------
--- ../LDAP.pm.orig	2006-03-18 22:35:21.000000000 +0100
+++ ../LDAP.pm	2006-03-18 22:39:41.000000000 +0100
@@ -305,6 +313,19 @@ sub createObject
             if ($sync) { $newuid_db{$guid} = $uid; } else { $uid_db{$guid} = $uid; }
 	    if( !$is_external ) {
 	      Kolab::Cyrus::createMailbox($cyrus, $uid, ($p eq 'sf' ? 1 : 0));
+	      if( $p eq 'sf' ){
+    		my $foldertype = lc($object->get_value('foldertype'));
+		my $type = 'mail';
+
+    		if( $foldertype eq 'task' ) { $type = 'task'; }
+                elsif( $foldertype eq 'journal' ) { $type = 'journal'; }
+                elsif( $foldertype eq 'event' ) { $type = 'event'; }
+                elsif( $foldertype eq 'contact' ) { $type = 'contact'; }
+                elsif( $foldertype eq 'note' ) { $type = 'note'; }
+		else { $type = 'mail'; }
+
+		Kolab::Cyrus::setFolderType($cyrus,$uid,1,$type);
+	      }
 	      if( $p ne 'sf' && !$islocal ) {
 		# Hide user mailboxes on other servers
 		Kolab::Cyrus::setACL($cyrus,$uid,0, ["$uid rswipcda"]);
-------------- next part --------------
--- ../kolab2.schema.orig	2006-03-18 22:35:48.000000000 +0100
+++ ../kolab2.schema	2006-03-18 22:34:34.000000000 +0100
@@ -92,6 +93,16 @@ attributetype ( 1.3.6.1.4.1.19414.2.1.6
   SUBSTR caseIgnoreIA5SubstringsMatch
   SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
 
+# folderType describes the type of a shared folder and can be
+# one of the following items
+attributetype ( 1.3.6.1.4.1.19414.2.1.7
+  NAME 'folderType'
+  DESC 'type of a kolabSharedFolder'
+  EQUALITY caseIgnoreIA5Match
+  SUBSTR caseIgnoreIA5SubstringsMatch
+  SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+
+
 # fqdn of the server containg the actual user data
 attributetype ( 1.3.6.1.4.1.19419.1.1.1.1
   NAME 'kolabHomeServer'
@@ -504,6 +515,7 @@ objectclass ( 1.3.6.1.4.1.19414.2.2.9 
   MAY ( acl $
         cyrus-userquota $
         kolabHomeServer $
+	folderType $
         kolabDeleteflag ) )
 
 # used as a plain node for the LDAP tree. In contrast to unix filesystem directories


More information about the devel mailing list