account.pm
branchfoerste
changeset 64 6a6c18cddf46
parent 60 3293084cfdd9
child 68 e8285fb4fb63
--- a/account.pm	Tue Dec 13 13:01:23 2011 +0100
+++ b/account.pm	Tue Dec 13 13:39:03 2011 +0100
@@ -190,7 +190,9 @@
 
             verbose('exists')
 
-        } elsif ( ($imap->login( $user, $pw ) or die $@) and $imap->capability->{acl} ) {
+        } elsif ( ( $imap->login( $user, $pw ) or die $@ )
+            and $imap->capability->{acl} )
+        {
 
             # wenn wir acl verwenden,
             #  * dann triggert 'list' acl file (und damit maildir) erzeugung
@@ -199,6 +201,7 @@
             #  (sofern wir das nicht eleganter über globale acl regeln können)
             #    (lra: sicht-, les- und administrierbar)
             my $f = $imap->list( '', '*' ) or die $@;
+
             #$imap->setacl( $f->[0]->[2], $Cf->imap_admin, 'lra' ) or die $@;
             verbose('ok');
 
@@ -325,10 +328,10 @@
 
             my $ag = $Cf->aclgroups;
 
-            if ($ag =~ /(^|,\s*)[+-]/) {
+            if ( $ag =~ /(^|,\s*)[+-]/ ) {
                 my %x;
-                @x{split /,/, $e->get_value(AT_ACLGROUPS)} = ();
-                for (split /,/, $ag) {
+                @x{ split /,/, $e->get_value(AT_ACLGROUPS) } = ();
+                for ( split /,/, $ag ) {
                     if (s/^-//) {
                         delete $x{$_};
                     } else {
@@ -440,7 +443,8 @@
             }
         }
 
-        print "Don't forget to remove acl entries for this user if any exist!\n";
+        print
+          "Don't forget to remove acl entries for this user if any exist!\n";
         verbose("\n");
 
     }
@@ -488,14 +492,14 @@
         $imap->login( "$uid*" . $Cf->imap_admin, $imap_password ) or die $@;
 
         my %q;
-        if ($imap->capability->{quota}) {
+        if ( $imap->capability->{quota} ) {
 
             # prepare patterns for shared folders - we want to ignore them in
             # quota calculations (TODO: what happens if a user has/attempts to
             # create a folder with the name of a namespace? he could avoid
             # quota limits that way?)
             my $ns = $imap->namespace() or die $@;
-            my @p = map qr{^\Q$_->[0]\E}, (@{$ns->[1]}, @{$ns->[2]});
+            my @p = map qr{^\Q$_->[0]\E}, ( @{ $ns->[1] }, @{ $ns->[2] } );
 
             my $folders = $imap->list( '', '*' ) or die $@;
 
@@ -504,10 +508,11 @@
                 # single folder sieht wie folgt aus: [[flag1, flag2, ...], separator, foldername]
                 #next if '\\Noselect' ~~ $f->[0];
                 # ignore shared folders
-                map { next if ( $f->[2] . $f->[1]) =~ $_ } @p;
+                map { next if ( $f->[2] . $f->[1] ) =~ $_ } @p;
                 my $q = $imap->getquotaroot( $f->[2] )
-                    or $@ eq q{IMAP Command : 'getquotaroot' failed. Response was : no - Not showing other users' quota.}
-                    or die $@;
+                  or $@ eq
+                  q{IMAP Command : 'getquotaroot' failed. Response was : no - Not showing other users' quota.}
+                  or die $@;
                 delete $q->{quotaroot};
                 %q = ( %q, %{$q} );
 
@@ -539,7 +544,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;
+        print wrap( "\t", "\t\t", "ACL Groups: $ag\n" )     if $ag;
 
     }
 }