From b666137a7036a1fb095b17c767f342028df8211c Mon Sep 17 00:00:00 2001 From: smizrahi Date: Wed, 28 Jun 2023 14:34:37 +0200 Subject: [PATCH] fix(preferences): Disable auxiliary mail accounts creation when SOGoCreateIdentitiesDisabled is enabled --- Documentation/SOGoInstallationGuide.asciidoc | 2 +- UI/PreferencesUI/UIxPreferences.m | 8 ++++++++ UI/Templates/PreferencesUI/UIxPreferences.wox | 16 +++++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 9768db7f2..8b7bf8ab6 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -817,7 +817,7 @@ specified as an array of dictionaries. |JWT secret according to RFC-7519. Default value is `SOGo`. |D |SOGoCreateIdentitiesDisabled -|Disable identity creation for users in preferences. If `YES`, users won't be able to add new identities and will allow to change only full name, signature and default identity. Default value is `NO`. +|Disable identity creation for users in preferences. If `YES`, users won't be able to add new identities and will allow to change only full name, signature and default identity. Default value is `NO`. Note : If this settings is set to `YES`, it will not be possible to crete auxiliary mail accounts. diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 020c2cdb6..9fc4c6a14 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -1807,4 +1807,12 @@ static NSArray *reminderValues = nil; return ![[SOGoSystemDefaults sharedSystemDefaults] isEasUIDisabled]; } +- (BOOL) showCreateIdentity +{ + SOGoDomainDefaults *dd; + dd = [[context activeUser] domainDefaults]; + + return ![dd createIdentitiesDisabled]; +} + @end diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index fbb038f19..b3ed9fe89 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -949,13 +949,15 @@ -
- - - -
+ +
+ + + +
+