Merge pull request #3927 from owncloud/Fix_new_user_empty_group

Do not add groups if user has no groups
This commit is contained in:
Raghu Nayyar 2013-07-04 11:50:19 -07:00
commit b2afbe0e8b
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);
}