summaryrefslogtreecommitdiff
path: root/lib/Kolab/Cyrus.pm
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-20 14:17:52 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-03-20 14:17:52 (GMT)
commit6640df17e23dc034ce60924cdcca762f3f555f41 (patch)
tree231941b0ae86201ef655091261a9b3b7a1097ffa /lib/Kolab/Cyrus.pm
parentbb6a22f3ff17c3dbc087f29b8bcf799ee0503be9 (diff)
downloadperl-Kolab-6640df17e23dc034ce60924cdcca762f3f555f41.tar.gz
Fix indentation to be consistent
Diffstat (limited to 'lib/Kolab/Cyrus.pm')
-rw-r--r--lib/Kolab/Cyrus.pm70
1 files changed, 35 insertions, 35 deletions
diff --git a/lib/Kolab/Cyrus.pm b/lib/Kolab/Cyrus.pm
index 4973add..f4462af 100644
--- a/lib/Kolab/Cyrus.pm
+++ b/lib/Kolab/Cyrus.pm
@@ -63,7 +63,7 @@ sub create
if (!$cyrus) {
Kolab::log('Y', 'Unable to connect to local Cyrus admin interface', KOLAB_ERROR);
- return 0;
+ return 0;
}
if (!$cyrus->authenticate(
@@ -72,7 +72,7 @@ sub create
'Mechanism' => 'LOGIN',
)) {
Kolab::log('Y', "Unable to authenticate with Cyrus admin interface, Error = `" . $cyrus->error . "'", KOLAB_ERROR);
- return 0;
+ return 0;
}
return $cyrus;
@@ -84,10 +84,10 @@ sub createUid
my $sf = shift || 0;
my $seperator = '/';
my $uidprefix = 'user';
- if ($sf) {
- $seperator = '.';
+ if ($sf) {
+ $seperator = '.';
$uidprefix = 'shared';
- }
+ }
return $uidprefix . $seperator . $user;
# return 'user' . ($sf ? '.' : '/') . $user;
}
@@ -124,21 +124,21 @@ sub createCalendar
my @mailboxes = $cyrus->list("user/$user/*\@$domain");
my %info;
foreach my $mailbox (@mailboxes) {
- my $u = @{$mailbox}[0];
- %info = $cyrus->info($u, ('/vendor/kolab/folder-type'));
- my $key = '/mailbox/{' . $u . '}/vendor/kolab/folder-type';
- if (exists($info{$key}) && $info{$key} eq 'event.default') {
- $calendar = $u;
- }
+ my $u = @{$mailbox}[0];
+ %info = $cyrus->info($u, ('/vendor/kolab/folder-type'));
+ my $key = '/mailbox/{' . $u . '}/vendor/kolab/folder-type';
+ if (exists($info{$key}) && $info{$key} eq 'event.default') {
+ $calendar = $u;
+ }
}
if ($calendar) {
Kolab::log('Y', "Skipping calendar creation for $user\@$domain as $calendar is a default calendar.", KOLAB_DEBUG);
} else {
Kolab::log('Y', "Creating default calendar for $user\@$domain.", KOLAB_DEBUG);
- createMailbox($cyrus, $folder, 0);
- setFolderType($cyrus, $folder, 0, 'event.default');
- setACL($cyrus, $folder, 0, $acl);
+ createMailbox($cyrus, $folder, 0);
+ setFolderType($cyrus, $folder, 0, 'event.default');
+ setACL($cyrus, $folder, 0, $acl);
Kolab::log('Y', "Successfully created default calendar for $user\@$domain.", KOLAB_DEBUG);
}
}
@@ -152,24 +152,24 @@ sub setQuota
my $cyruid = &createUid($uid, $sf);
if( $quota < 0 ) {
- return;
+ return;
}
(my $root, my %quota) = $cyrus->quotaroot($cyruid);
my $setquota = $quota{'STORAGE'}[1];
if (!defined($setquota) || ($setquota != $quota)) {
- if( $quota == 0 ) {
- Kolab::log('Y', "Removing quota from mailbox `$cyruid'");
- if (!$cyrus->setquota($cyruid)) {
- Kolab::log('Y', "Unable to remove quota for mailbox `$cyruid', Error = `" . $cyrus->error . "'", KOLAB_WARN);
- }
- } else {
- Kolab::log('Y', "Setting quota of mailbox `$cyruid' to $quota");
- if (!$cyrus->setquota($cyruid, 'STORAGE', $quota)) {
- Kolab::log('Y', "Unable to set quota for mailbox `$cyruid', Error = `" . $cyrus->error . "'", KOLAB_WARN);
- }
- }
+ if( $quota == 0 ) {
+ Kolab::log('Y', "Removing quota from mailbox `$cyruid'");
+ if (!$cyrus->setquota($cyruid)) {
+ Kolab::log('Y', "Unable to remove quota for mailbox `$cyruid', Error = `" . $cyrus->error . "'", KOLAB_WARN);
+ }
+ } else {
+ Kolab::log('Y', "Setting quota of mailbox `$cyruid' to $quota");
+ if (!$cyrus->setquota($cyruid, 'STORAGE', $quota)) {
+ Kolab::log('Y', "Unable to set quota for mailbox `$cyruid', Error = `" . $cyrus->error . "'", KOLAB_WARN);
+ }
+ }
}
}
@@ -224,15 +224,15 @@ sub setACL
}
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);
- }
+ 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;