aboutsummaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-07-09 15:29:38 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-07-09 15:29:38 +0200
commit506a3400e5215946da0c10ae8fa6045ed90ffd51 (patch)
treeaca995de2abddeeb64f7e731e71bb59f02b430f4 /settings/js
parentf76deb9f87d6d1a43925314e35f9978f00e30521 (diff)
downloadnextcloud-server-506a3400e5215946da0c10ae8fa6045ed90ffd51.tar.gz
nextcloud-server-506a3400e5215946da0c10ae8fa6045ed90ffd51.zip
remove the group in case the last user has removed from that group
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/users/users.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index f04761e6f10..5775d83d098 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -393,6 +393,18 @@ var UserList = {
) {
UserList.availableGroups.push(response.data.groupname);
}
+
+ // in case this was the last user in that group the group has to be removed
+ var groupElement = GroupList.getGroupLI(response.data.groupname);
+ var userCount = GroupList.getUserCount(groupElement);
+ if (response.data.action === 'remove' && userCount === 1) {
+ _.without(UserList.availableGroups, response.data.groupname);
+ GroupList.remove(response.data.groupname);
+ $('.groupsselect option[value='+response.data.groupname+']').remove();
+ $('.subadminsselect option[value='+response.data.groupname+']').remove();
+ }
+
+
}
if (response.data.message) {
OC.Notification.show(response.data.message);