mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-30 23:55:34 +00:00
(js) Fix handling of prevent invitations whitelist
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
if (!this.$$shortFormat)
|
||||
this.$$shortFormat = this.$shortFormat();
|
||||
if (!this.$$image)
|
||||
this.$$image = this.image || User.$gravatar(this.c_email);
|
||||
this.$$image = this.image || User.$gravatar(this.c_email, 32, User.$alternateAvatar);
|
||||
|
||||
// An empty attribute to trick md-autocomplete when adding users from the ACLs editor
|
||||
this.empty = ' ';
|
||||
|
||||
@@ -52,11 +52,15 @@
|
||||
|
||||
this.settingsPromise = Preferences.$$resource.fetch("jsonSettings").then(function(data) {
|
||||
// We convert our PreventInvitationsWhitelist hash into a array of user
|
||||
if (data.Calendar && data.Calendar.PreventInvitationsWhitelist)
|
||||
if (data.Calendar) {
|
||||
if (data.Calendar.PreventInvitationsWhitelist)
|
||||
data.Calendar.PreventInvitationsWhitelist = _.map(data.Calendar.PreventInvitationsWhitelist, function(value, key) {
|
||||
var match = /^(.+)\s<(\S+)>$/.exec(value);
|
||||
return new Preferences.$User({uid: key, cn: match[1], c_email: match[2]});
|
||||
});
|
||||
else
|
||||
data.Calendar.PreventInvitationsWhitelist = [];
|
||||
}
|
||||
|
||||
angular.extend(_this.settings, data);
|
||||
|
||||
|
||||
@@ -49,6 +49,12 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Set alternate avatar in User service
|
||||
statePreferences.ready().then(function() {
|
||||
if (statePreferences.defaults.SOGoAlternateAvatar)
|
||||
User.$alternateAvatar = statePreferences.defaults.SOGoAlternateAvatar;
|
||||
});
|
||||
|
||||
function go(module) {
|
||||
$state.go('preferences.' + module);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user