diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-07-05 02:14:08 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-07-09 14:30:39 +0200 |
commit | 5e5a02cc2f377e231176e56649168e120d14b177 (patch) | |
tree | fbe85c37f6ecb509940439bf55165981852559d1 /settings | |
parent | a584022ecc7f186386a748122a84e21615e29399 (diff) | |
download | nextcloud-server-5e5a02cc2f377e231176e56649168e120d14b177.tar.gz nextcloud-server-5e5a02cc2f377e231176e56649168e120d14b177.zip |
decrease user count in affected groups after user delete
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/users/users.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 170a4bd89da..923dd9fcfb9 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -238,6 +238,20 @@ var UserList = { UserList.getRow(uid).show(); }, remove: function(uid) { + $tr = UserList.getRow(uid); + groups = $tr.find('.groups .groupsselect').val(); + for(i in groups) { + var gid = groups[i]; + $li = GroupList.getGroupLI(gid); + userCount = GroupList.getUserCount($li); + if(userCount == 1) { + newUserCount = ''; + } else { + newUserCount = userCount - 1; + } + GroupList.setUserCount($li, newUserCount); + } + UserList.getRow(uid).remove(); }, has: function(uid) { |