mirror of
https://github.com/nextcloud/server.git
synced 2024-07-30 20:16:04 +02:00
Fix users loading on group click and group creation on select
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
00122fa027
commit
ddcd37121f
@ -18,6 +18,9 @@ GroupList = {
|
|||||||
filterGroups: false,
|
filterGroups: false,
|
||||||
|
|
||||||
addGroup: function (gid, displayName, usercount) {
|
addGroup: function (gid, displayName, usercount) {
|
||||||
|
if (_.isUndefined(displayName)) {
|
||||||
|
displayName = gid;
|
||||||
|
}
|
||||||
var $li = $userGroupList.find('.isgroup:last-child').clone();
|
var $li = $userGroupList.find('.isgroup:last-child').clone();
|
||||||
$li
|
$li
|
||||||
.data('gid', gid)
|
.data('gid', gid)
|
||||||
@ -142,7 +145,7 @@ GroupList = {
|
|||||||
function (result) {
|
function (result) {
|
||||||
if (result.groupname) {
|
if (result.groupname) {
|
||||||
var addedGroup = result.groupname;
|
var addedGroup = result.groupname;
|
||||||
UserList.availableGroups[result.id] = {displayName: result.groupName};
|
UserList.availableGroups[groupid] = {displayName: result.groupname};
|
||||||
GroupList.addGroup(groupid, result.groupname);
|
GroupList.addGroup(groupid, result.groupname);
|
||||||
}
|
}
|
||||||
GroupList.toggleAddGroup();
|
GroupList.toggleAddGroup();
|
||||||
|
@ -66,7 +66,7 @@ var UserList = {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
add: function (user) {
|
add: function (user) {
|
||||||
if (this.currentGid && this.currentGid !== '_everyone' && this.currentGid !== '_disabledUsers' && _.indexOf(user.groups, this.currentGid) < 0) {
|
if (this.currentGid && this.currentGid !== '_everyone' && this.currentGid !== '_disabledUsers' && Object.keys(user.groups).indexOf(this.currentGid) < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +454,6 @@ var UserList = {
|
|||||||
if (!OC.isUserAdmin() && checked.length === 1 && checked[0] === group) {
|
if (!OC.isUserAdmin() && checked.length === 1 && checked[0] === group) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (add && OC.isUserAdmin() && _.isUndefined(UserList.availableGroups[group])) {
|
if (add && OC.isUserAdmin() && _.isUndefined(UserList.availableGroups[group])) {
|
||||||
GroupList.createGroup(group);
|
GroupList.createGroup(group);
|
||||||
if (_.isUndefined(UserList.availableGroups[group])) {
|
if (_.isUndefined(UserList.availableGroups[group])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user