fix(preferences): Disable auxiliary mail accounts creation when SOGoCreateIdentitiesDisabled is enabled

This commit is contained in:
smizrahi
2023-06-28 14:34:37 +02:00
parent a95f6c0799
commit b666137a70
3 changed files with 18 additions and 8 deletions
+1 -1
View File
@@ -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.
+8
View File
@@ -1807,4 +1807,12 @@ static NSArray *reminderValues = nil;
return ![[SOGoSystemDefaults sharedSystemDefaults] isEasUIDisabled];
}
- (BOOL) showCreateIdentity
{
SOGoDomainDefaults *dd;
dd = [[context activeUser] domainDefaults];
return ![dd createIdentitiesDisabled];
}
@end
@@ -949,13 +949,15 @@
</md-list>
<var:if condition="mailAuxiliaryUserAccountsEnabled">
<div layout="row" layout-align="end center">
<md-button type="button"
ng-click="app.addMailAccount($event, preferencesForm)"
label:aria-label="Create Account">
<var:string label:value="New Mail Account"/>
</md-button>
</div>
<var:if condition="showCreateIdentity">
<div layout="row" layout-align="end center">
<md-button type="button"
ng-click="app.addMailAccount($event, preferencesForm)"
label:aria-label="Create Account">
<var:string label:value="New Mail Account"/>
</md-button>
</div>
</var:if>
</var:if>
</md-tab>