mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-23 05:49:31 +00:00
(obj-c) Indentation
This commit is contained in:
@@ -94,9 +94,9 @@
|
||||
- (void) usage
|
||||
{
|
||||
fprintf (stderr, "backup directory ALL|user1 [user2] ...\n\n"
|
||||
" directory the target directory where backup files will be stored\n"
|
||||
" user the user of whom to save the data or ALL for everybody\n\n"
|
||||
"Example: sogo-tool backup /tmp/foo ALL\n");
|
||||
" directory the target directory where backup files will be stored\n"
|
||||
" user the user of whom to save the data or ALL for everybody\n\n"
|
||||
"Example: sogo-tool backup /tmp/foo ALL\n");
|
||||
}
|
||||
|
||||
- (BOOL) checkDirectory
|
||||
@@ -155,25 +155,25 @@
|
||||
folderLocation = [fm folderInfoLocation];
|
||||
fc = [cm acquireOpenChannelForURL: folderLocation];
|
||||
if (fc)
|
||||
{
|
||||
allSqlUsers = [NSMutableArray new];
|
||||
sql
|
||||
= [NSString stringWithFormat: @"SELECT DISTINCT c_path2 FROM %@",
|
||||
[folderLocation gcsTableName]];
|
||||
[fc evaluateExpressionX: sql];
|
||||
attrs = [fc describeResults: NO];
|
||||
while ((infos = [fc fetchAttributes: attrs withZone: NULL]))
|
||||
{
|
||||
user = [infos objectForKey: @"c_path2"];
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
{
|
||||
allSqlUsers = [NSMutableArray new];
|
||||
sql
|
||||
= [NSString stringWithFormat: @"SELECT DISTINCT c_path2 FROM %@",
|
||||
[folderLocation gcsTableName]];
|
||||
[fc evaluateExpressionX: sql];
|
||||
attrs = [fc describeResults: NO];
|
||||
while ((infos = [fc fetchAttributes: attrs withZone: NULL]))
|
||||
{
|
||||
user = [infos objectForKey: @"c_path2"];
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
[allSqlUsers autorelease];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
@@ -181,37 +181,37 @@
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
if (count > 0 && count%100 == 0)
|
||||
{
|
||||
DESTROY(pool);
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
{
|
||||
DESTROY(pool);
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
user = [users objectAtIndex: count];
|
||||
infos = [lm contactInfosForUserWithUIDorEmail: user];
|
||||
if (infos)
|
||||
[allUsers addObject: infos];
|
||||
[allUsers addObject: infos];
|
||||
else
|
||||
{
|
||||
// We haven't found the user based on the GCS table name
|
||||
// Let's try to strip the domain part and search again.
|
||||
// This can happen when using SOGoEnableDomainBasedUID (YES)
|
||||
// but login in SOGo using a UID without domain (DomainLessLogin gets set)
|
||||
NSRange r;
|
||||
{
|
||||
// We haven't found the user based on the GCS table name
|
||||
// Let's try to strip the domain part and search again.
|
||||
// This can happen when using SOGoEnableDomainBasedUID (YES)
|
||||
// but login in SOGo using a UID without domain (DomainLessLogin gets set)
|
||||
NSRange r;
|
||||
|
||||
r = [user rangeOfString: @"@"];
|
||||
r = [user rangeOfString: @"@"];
|
||||
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
user = [user substringToIndex: r.location];
|
||||
infos = [lm contactInfosForUserWithUIDorEmail: user];
|
||||
if (infos)
|
||||
[allUsers addObject: infos];
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
user = [user substringToIndex: r.location];
|
||||
infos = [lm contactInfosForUserWithUIDorEmail: user];
|
||||
if (infos)
|
||||
[allUsers addObject: infos];
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
}
|
||||
[allUsers autorelease];
|
||||
|
||||
@@ -262,9 +262,9 @@
|
||||
if (fc)
|
||||
{
|
||||
sql
|
||||
= [NSString stringWithFormat: (@"SELECT c_foldername FROM %@"
|
||||
@" WHERE c_path = '%@'"),
|
||||
[folderLocation gcsTableName], folder];
|
||||
= [NSString stringWithFormat: (@"SELECT c_foldername FROM %@"
|
||||
@" WHERE c_path = '%@'"),
|
||||
[folderLocation gcsTableName], folder];
|
||||
[fc evaluateExpressionX: sql];
|
||||
attrs = [fc describeResults: NO];
|
||||
row = [fc fetchAttributes: attrs withZone: NULL];
|
||||
@@ -342,7 +342,7 @@
|
||||
forKey: @"acl"];
|
||||
[folderRecord setObject: tableRecord forKey: folder];
|
||||
rc = YES;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Unable to extract records for folder %@", folder);
|
||||
@@ -399,11 +399,11 @@
|
||||
currentSource = [lm sourceWithID: sourceID];
|
||||
userEntry = [currentSource lookupContactEntry: uid inDomain: domain];
|
||||
if (userEntry)
|
||||
{
|
||||
{
|
||||
[userRecord setObject: [userEntry ldifRecordAsString]
|
||||
forKey: @"ldif_record"];
|
||||
done = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
||||
@@ -77,9 +77,9 @@
|
||||
- (void) usage
|
||||
{
|
||||
fprintf (stderr, "cleanup [days] [user]...\n\n"
|
||||
" days the age of deleted records to purge in days\n"
|
||||
" user the user to purge the records or ALL for everybody\n\n"
|
||||
"Example: sogo-tool cleanup jdoe\n");
|
||||
" days the age of deleted records to purge in days\n"
|
||||
" user the user to purge the records or ALL for everybody\n\n"
|
||||
"Example: sogo-tool cleanup jdoe\n");
|
||||
}
|
||||
|
||||
- (BOOL) fetchUserIDs: (NSArray *) users
|
||||
@@ -110,24 +110,24 @@
|
||||
folderLocation = [fm folderInfoLocation];
|
||||
fc = [cm acquireOpenChannelForURL: folderLocation];
|
||||
if (fc)
|
||||
{
|
||||
allSqlUsers = [NSMutableArray new];
|
||||
sql = [NSString stringWithFormat: @"SELECT DISTINCT c_path2 FROM %@",
|
||||
{
|
||||
allSqlUsers = [NSMutableArray new];
|
||||
sql = [NSString stringWithFormat: @"SELECT DISTINCT c_path2 FROM %@",
|
||||
[folderLocation gcsTableName]];
|
||||
[fc evaluateExpressionX: sql];
|
||||
attrs = [fc describeResults: NO];
|
||||
while ((infos = [fc fetchAttributes: attrs withZone: NULL]))
|
||||
{
|
||||
user = [infos objectForKey: @"c_path2"];
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
[fc evaluateExpressionX: sql];
|
||||
attrs = [fc describeResults: NO];
|
||||
while ((infos = [fc fetchAttributes: attrs withZone: NULL]))
|
||||
{
|
||||
user = [infos objectForKey: @"c_path2"];
|
||||
if (user)
|
||||
[allSqlUsers addObject: user];
|
||||
}
|
||||
[cm releaseChannel: fc];
|
||||
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
users = allSqlUsers;
|
||||
max = [users count];
|
||||
[allSqlUsers autorelease];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
@@ -135,37 +135,37 @@
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
if (count > 0 && count%100 == 0)
|
||||
{
|
||||
DESTROY(pool);
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
{
|
||||
DESTROY(pool);
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
}
|
||||
|
||||
user = [users objectAtIndex: count];
|
||||
infos = [lm contactInfosForUserWithUIDorEmail: user];
|
||||
if (infos)
|
||||
[allUsers addObject: infos];
|
||||
[allUsers addObject: infos];
|
||||
else
|
||||
{
|
||||
// We haven't found the user based on the GCS table name
|
||||
// Let's try to strip the domain part and search again.
|
||||
// This can happen when using SOGoEnableDomainBasedUID (YES)
|
||||
// but login in SOGo using a UID without domain (DomainLessLogin gets set)
|
||||
NSRange r;
|
||||
{
|
||||
// We haven't found the user based on the GCS table name
|
||||
// Let's try to strip the domain part and search again.
|
||||
// This can happen when using SOGoEnableDomainBasedUID (YES)
|
||||
// but login in SOGo using a UID without domain (DomainLessLogin gets set)
|
||||
NSRange r;
|
||||
|
||||
r = [user rangeOfString: @"@"];
|
||||
r = [user rangeOfString: @"@"];
|
||||
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
user = [user substringToIndex: r.location];
|
||||
infos = [lm contactInfosForUserWithUIDorEmail: user];
|
||||
if (infos)
|
||||
[allUsers addObject: infos];
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
user = [user substringToIndex: r.location];
|
||||
infos = [lm contactInfosForUserWithUIDorEmail: user];
|
||||
if (infos)
|
||||
[allUsers addObject: infos];
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
else
|
||||
NSLog (@"user '%@' unknown", user);
|
||||
}
|
||||
}
|
||||
[allUsers autorelease];
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
{
|
||||
NSLog(@"Unable to purge records of folder %@", folder);
|
||||
rc = NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Purged %u records from folder %@", count, folder);
|
||||
|
||||
Reference in New Issue
Block a user