aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-10-15 18:19:23 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-10-21 10:09:26 +0200
commit72a8703627e50ff1b55d894beec28a37ae5c6a29 (patch)
treebf527d9e51b77fd997ba4edd519851fbff26b100
parentb41e3f8f081bd1cb3c2fc9b478dfa3f6533b92f7 (diff)
downloadnextcloud-server-72a8703627e50ff1b55d894beec28a37ae5c6a29.tar.gz
nextcloud-server-72a8703627e50ff1b55d894beec28a37ae5c6a29.zip
when adding/removing users from groups don't touch counters if LDAP
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/settings/src/store/users.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js
index e2eb94610af..7a98af147e8 100644
--- a/apps/settings/src/store/users.js
+++ b/apps/settings/src/store/users.js
@@ -98,7 +98,7 @@ const mutations = {
let group = state.groups.find(groupSearch => groupSearch.id === gid)
let user = state.users.find(user => user.id === userid)
// increase count if user is enabled
- if (group && user.enabled) {
+ if (group && user.enabled && state.userCount > 0) {
group.usercount++
}
let groups = user.groups
@@ -109,7 +109,7 @@ const mutations = {
let group = state.groups.find(groupSearch => groupSearch.id === gid)
let user = state.users.find(user => user.id === userid)
// lower count if user is enabled
- if (group && user.enabled) {
+ if (group && user.enabled && state.userCount > 0) {
group.usercount--
}
let groups = user.groups
@@ -135,12 +135,14 @@ const mutations = {
let user = state.users.find(user => user.id === userid)
user.enabled = enabled
// increment or not
- state.groups.find(group => group.id === 'disabled').usercount += enabled ? -1 : 1
- state.userCount += enabled ? 1 : -1
- user.groups.forEach(group => {
- // Increment disabled count
- state.groups.find(groupSearch => groupSearch.id === group).disabled += enabled ? -1 : 1
- })
+ if (state.userCount > 0) {
+ state.groups.find(group => group.id === 'disabled').usercount += enabled ? -1 : 1
+ state.userCount += enabled ? 1 : -1
+ user.groups.forEach(group => {
+ // Increment disabled count
+ state.groups.find(groupSearch => groupSearch.id === group).disabled += enabled ? -1 : 1
+ })
+ }
},
setUserData(state, { userid, key, value }) {
if (key === 'quota') {