account.pm
branchfoerste
changeset 59 df896a01960d
parent 55 ef65e9adf0f6
child 60 3293084cfdd9
--- a/account.pm	Sun Dec 11 11:48:25 2011 +0100
+++ b/account.pm	Sun Dec 11 22:36:33 2011 +0100
@@ -36,6 +36,7 @@
 sub AT_GROUP();
 sub AT_FORWARDINGADDRESS();
 sub AT_QUOTA();
+sub AT_ACLGROUPS();
 
 sub import(@) {
     $Cf = shift;
@@ -49,6 +50,7 @@
     import constant AT_GROUP             => $Cf->ldap_at_group;
     import constant AT_FORWARDINGADDRESS => $Cf->ldap_at_forwardingaddress;
     import constant AT_QUOTA             => $Cf->ldap_at_quota;
+    import constant AT_ACLGROUPS         => $Cf->ldap_at_aclgroups;
 
     $ubase = OU_ACCOUNTS . "," . $Cf->ldap_base;
     $abase = OU_ALIASES . "," . $Cf->ldap_base;
@@ -164,6 +166,7 @@
         $e->add( (AT_FORWARDINGADDRESS) => $mailForwardingAddress )
           if @$mailForwardingAddress;
         $e->add( (AT_QUOTA) => $Cf->imap_quota );
+        $e->add( (AT_ACLGROUPS) => $Cf->imap_aclgroups ) if $Cf->imap_aclgroups;
 
         # $e->add(iusRestrictedMail => $Cf->internal) if $Cf->internal ne ":";
 
@@ -313,6 +316,16 @@
             $modified++;
         }
 
+        if ( defined $Cf->quota ) {
+            $e->replace( (AT_QUOTA) => $Cf->quota );
+            $modified++;
+        }
+
+        if ( defined $Cf->aclgroups ) {
+            $e->replace( (AT_ACLGROUPS) => $Cf->aclgroups );
+            $modified++;
+        }
+
         if ( my $a = $Cf->primary ) {
             $r = $ldap->search(
                 base => $ubase,
@@ -436,6 +449,7 @@
         my $ml   = join( ", ", $e->get_value(AT_ADDRESS) ) || "";           # ??
         my $mg   = join( ", ", $e->get_value(AT_GROUP) ) || "";             # ??
         my $forw = join( ", ", $e->get_value(AT_FORWARDINGADDRESS) ) || "";
+        my $ag   = $e->get_value(AT_ACLGROUPS);
 
         print "$uid: $cn <$mr>";
 
@@ -506,6 +520,7 @@
         print wrap( "\t", "\t\t", "Other Adresses: $ml\n" ) if $ml;
         print wrap( "\t", "\t\t", "Mail Groups: $mg\n" )    if $mg;
         print wrap( "\t", "\t\t", "Forwardings: $forw\n" )  if $forw;
+        print wrap( "\t", "\t\t", "ACL Groups: $ag\n" )  if $ag;
 
     }
 }