Skip to content

Commit a705af8

Browse files
authored
Merge pull request #18285 from nextcloud/backport/18228/15
[stable 15] Fix removing groups that have a slash in the name
2 parents c6f06ab + 04a472c commit a705af8

6 files changed

Lines changed: 30 additions & 30 deletions

File tree

settings/js/3.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/4.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-admin-security.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-vue.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-vue.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/src/store/users.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const mutations = {
7070
state.orderBy = orderBy;
7171
state.userCount = userCount;
7272
state.groups = orderGroups(state.groups, state.orderBy);
73-
73+
7474
},
7575
addGroup(state, {gid, displayName}) {
7676
try {
@@ -99,7 +99,7 @@ const mutations = {
9999
let user = state.users.find(user => user.id == userid);
100100
// increase count if user is enabled
101101
if (group && user.enabled) {
102-
group.usercount++;
102+
group.usercount++;
103103
}
104104
let groups = user.groups;
105105
groups.push(gid);
@@ -189,7 +189,7 @@ const actions = {
189189

190190
/**
191191
* Get all users with full details
192-
*
192+
*
193193
* @param {Object} context
194194
* @param {Object} options
195195
* @param {int} options.offset List offset to request
@@ -242,7 +242,7 @@ const actions = {
242242

243243
/**
244244
* Get all users with full details
245-
*
245+
*
246246
* @param {Object} context
247247
* @param {Object} options
248248
* @param {int} options.offset List offset to request
@@ -264,7 +264,7 @@ const actions = {
264264

265265
/**
266266
* Get all users with full details from a groupid
267-
*
267+
*
268268
* @param {Object} context
269269
* @param {Object} options
270270
* @param {int} options.offset List offset to request
@@ -276,7 +276,7 @@ const actions = {
276276
.then((response) => context.commit('getUsersFromList', response.data.ocs.data.users))
277277
.catch((error) => context.commit('API_FAILURE', error));
278278
},
279-
279+
280280

281281
getPasswordPolicyMinLength(context) {
282282
if(oc_capabilities.password_policy && oc_capabilities.password_policy.minLength) {
@@ -288,7 +288,7 @@ const actions = {
288288

289289
/**
290290
* Add group
291-
*
291+
*
292292
* @param {Object} context
293293
* @param {string} gid Group id
294294
* @returns {Promise}
@@ -311,22 +311,22 @@ const actions = {
311311

312312
/**
313313
* Remove group
314-
*
314+
*
315315
* @param {Object} context
316316
* @param {string} gid Group id
317317
* @returns {Promise}
318318
*/
319319
removeGroup(context, gid) {
320320
return api.requireAdmin().then((response) => {
321-
return api.delete(OC.linkToOCS(`cloud/groups/${gid}`, 2))
321+
return api.delete(OC.linkToOCS(`cloud/groups/${encodeURIComponent(gid)}`, 2))
322322
.then((response) => context.commit('removeGroup', gid))
323323
.catch((error) => {throw error;});
324324
}).catch((error) => context.commit('API_FAILURE', { gid, error }));
325325
},
326326

327327
/**
328328
* Add user to group
329-
*
329+
*
330330
* @param {Object} context
331331
* @param {Object} options
332332
* @param {string} options.userid User id
@@ -343,7 +343,7 @@ const actions = {
343343

344344
/**
345345
* Remove user from group
346-
*
346+
*
347347
* @param {Object} context
348348
* @param {Object} options
349349
* @param {string} options.userid User id
@@ -359,13 +359,13 @@ const actions = {
359359
context.commit('API_FAILURE', { userid, error });
360360
// let's throw one more time to prevent
361361
// the view from removing the user row on failure
362-
throw error;
362+
throw error;
363363
});
364364
},
365365

366366
/**
367367
* Add user to group admin
368-
*
368+
*
369369
* @param {Object} context
370370
* @param {Object} options
371371
* @param {string} options.userid User id
@@ -382,7 +382,7 @@ const actions = {
382382

383383
/**
384384
* Remove user from group admin
385-
*
385+
*
386386
* @param {Object} context
387387
* @param {Object} options
388388
* @param {string} options.userid User id
@@ -399,9 +399,9 @@ const actions = {
399399

400400
/**
401401
* Delete a user
402-
*
402+
*
403403
* @param {Object} context
404-
* @param {string} userid User id
404+
* @param {string} userid User id
405405
* @returns {Promise}
406406
*/
407407
deleteUser(context, userid) {
@@ -414,7 +414,7 @@ const actions = {
414414

415415
/**
416416
* Add a user
417-
*
417+
*
418418
* @param {Object} context
419419
* @param {Object} options
420420
* @param {string} options.userid User id
@@ -439,9 +439,9 @@ const actions = {
439439

440440
/**
441441
* Get user data and commit addition
442-
*
442+
*
443443
* @param {Object} context
444-
* @param {string} userid User id
444+
* @param {string} userid User id
445445
* @returns {Promise}
446446
*/
447447
addUserData(context, userid) {
@@ -452,8 +452,8 @@ const actions = {
452452
}).catch((error) => context.commit('API_FAILURE', { userid, error }));
453453
},
454454

455-
/** Enable or disable user
456-
*
455+
/** Enable or disable user
456+
*
457457
* @param {Object} context
458458
* @param {Object} options
459459
* @param {string} options.userid User id
@@ -471,8 +471,8 @@ const actions = {
471471

472472
/**
473473
* Edit user data
474-
*
475-
* @param {Object} context
474+
*
475+
* @param {Object} context
476476
* @param {Object} options
477477
* @param {string} options.userid User id
478478
* @param {string} options.key User field to edit
@@ -501,9 +501,9 @@ const actions = {
501501

502502
/**
503503
* Send welcome mail
504-
*
504+
*
505505
* @param {Object} context
506-
* @param {string} userid User id
506+
* @param {string} userid User id
507507
* @returns {Promise}
508508
*/
509509
sendWelcomeMail(context, userid) {

0 commit comments

Comments
 (0)