Do not add groups if user has no groups

This commit is contained in:
Victor Dubiniuk 2013-07-03 22:06:09 +03:00
parent 33e1ced53c
commit a20f7f1d67
1 changed files with 4 additions and 2 deletions

View File

@ -449,8 +449,10 @@ $(document).ready(function () {
OC.dialogs.alert(result.data.message,
t('settings', 'Error creating user'));
} else {
var addedGroups = result.data.groups.split(', ');
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
if (result.data.groups) {
var addedGroups = result.data.groups.split(', ');
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
}
if($('tr[data-uid="' + username + '"]').length === 0) {
UserList.add(username, username, result.data.groups, null, 'default', true);
}