Fixed user group management.

This commit is contained in:
Ylian Saint-Hilaire 2022-01-23 21:57:27 -08:00
parent 07b0c8fe86
commit ba8a73ec7a
2 changed files with 11 additions and 4 deletions

View File

@ -1474,8 +1474,11 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
}
// Get the domain
var delGroupDomain = parent.parent.config.domains[ugroupidsplit[1]];
if (delGroupDomain == null) { err = "Invalid domain id"; }
var delGroupDomain;
if (ugroupidsplit != null) {
delGroupDomain = parent.parent.config.domains[ugroupidsplit[1]];
if (delGroupDomain == null) { err = "Invalid domain id"; }
}
// Handle any errors
if (err != null) {

View File

@ -1121,7 +1121,7 @@
<td class="style14">
<div style="float:right">
</div>
<div>
<div id="p50userGroupOps">
<input type=button id=UsersGroupsSelectAllButton onclick="p50usersSelectallButtonFunction()" value="Select All" />
<input type=button id=UsersGroupsGroupActionButton disabled="disabled" value="Group Action" onclick=p50usersGroupActionFunction() />
<input id=NewUserGroupButton type=button onclick=showCreateUserGroupDialog(1) value="New Group..." />
@ -2053,6 +2053,7 @@
// We are user administrator
if (users == null) { meshserver.send({ action: 'users' }); }
if (wssessions == null) { meshserver.send({ action: 'wssessioncount' }); }
mainUpdate(8192 + 16384);
} else {
// We are not user administrator
users = null;
@ -14239,6 +14240,9 @@
//
function updateUserGroups() {
// Display user group operations only if allowed for us
QV('p50userGroupOps', (userinfo.siteadmin & 256) != 0); // SITERIGHT_USERGROUPS = 256
// Sort the list of group names
var sortedGroups = [], x = '';
if (usergroups) { for (var i in usergroups) { sortedGroups.push(usergroups[i]); } }
@ -14263,7 +14267,7 @@
// Re-check userid's
elements = document.getElementsByClassName('UserGroupCheckbox');
for (var i=0;i<elements.length;i++) { elements[i].checked = ((checkedUserGroupids.indexOf(elements[i].value) >= 0)); }
for (var i = 0; i < elements.length; i++) { elements[i].checked = ((checkedUserGroupids.indexOf(elements[i].value) >= 0)); }
p50updateInfo();
// Update current user panel if needed