mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-29 15:15:37 +00:00
(js) Fix handling of prevent invitations whitelist
This commit is contained in:
@@ -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