feat(preferences): allow hiding of vacation the vacation period

This is controllable using the new SOGoVacationPeriodEnabled
domain defaults variable.
This commit is contained in:
Ludovic Marcotte
2019-11-05 15:33:16 -05:00
parent 32968092e2
commit c2e7f6a866
7 changed files with 81 additions and 280 deletions

View File

@@ -83,6 +83,7 @@
BOOL result;
user = [SOGoUser userWithLogin: theLogin];
userDefaults = [user userDefaults];
vacationOptions = [[userDefaults vacationOptions] mutableCopy];
[vacationOptions autorelease];
@@ -93,6 +94,14 @@
}
else
{
// We do NOT enable the vacation message automatically if the domain
// preference is disabled by default.
if (![[user domainDefaults] vacationPeriodEnabled])
{
NSLog(@"SOGoVacationPeriodEnabled set to NO for the domain - ignoring.");
return NO;
}
[vacationOptions setObject: [NSNumber numberWithBool: NO] forKey: @"startDateEnabled"];
}