@@ -4105,7 +4106,8 @@
}
function cmdeskaction(action) {
- if (action == 1) { connectDesktop(null, 3, null, 0x0008); } // Do remote desktop connection using consent prompt
+ if (action == 1) { connectDesktop(null, 3, null, 0x0008 + 0x0040); } // Do remote desktop connection using Consent Prompt + Tool bar
+ if (action == 2) { connectDesktop(null, 3, null, 0x0008); } // Do remote desktop connection using Consent Prompt
}
function cmaltportaction(action) {
@@ -4989,7 +4991,9 @@
{{{StartGeoLocationJS}}}
if (xxmap != null) x += '' + "Location" + ' ';
{{{EndGeoLocationJS}}}
- if ((terminalAccess) && ((meshrights & 8) != 0) && (node.agent != null)) x += '' + "MeshCmd" + ' ';
+ if ((userinfo.siteadmin == 0xFFFFFFFF) || ((userinfo.siteadmin & 128) == 0)) { // Check if we should view tools
+ if ((terminalAccess) && ((meshrights & 8) != 0) && (node.agent != null)) x += '' + "MeshCmd" + ' ';
+ }
if ((args.xterm === 0) && (node.agent) && ((node.agent.caps & 2) != 0) && ((meshrights & 8) != 0) && ((meshrights == 0xFFFFFFFF) || ((meshrights & 512) == 0))) { x += '' + "XTerm" + ' '; }
// RDP link, show this link only of the remote machine is Windows.
@@ -5118,10 +5122,10 @@
if ((meshrights & 2) != 0) {
if (ugroup) {
trash = '';
- rights = '
' + rights + '
';
+ rights = '' + rights + ' ';
} else {
trash = '';
- rights = '
' + rights + '
';
+ rights = '' + rights + ' ';
}
}
if (users != null) {
@@ -8363,7 +8367,7 @@
var trash = '', r = sortedusers[i].rights, rights = makeDeviceGroupRightsString(r), icon = 2;
if ((sortedusers[i].id != userinfo._id) && (meshrights == 0xFFFFFFFF || (((meshrights & 2) != 0)))) {
trash = '';
- rights = '
' + rights + '
';
+ rights = '' + rights + ' ';
}
if (sortedusers[i].id.startsWith('ugrp/')) { icon = 4; }
var username = EscapeHtml(decodeURIComponent(sortedusers[i].name));
@@ -8576,44 +8580,50 @@
x += addHtmlValue("User Names", '');
x += '';
x += '
';
- } else if (userid === 1) {
+ } else if (userid == 1) {
var y = '';
if (selected == null) {
- for (var i in meshes) { if ((currentUser.links == null) || (currentUser.links[i] == null)) { y += ''; } }
+ var omeshs = getOrderedList(meshes, 'name');
+ for (var i in omeshs) { if ((currentUser.links == null) || (currentUser.links[omeshs[i]._id] == null)) { y += ''; } }
} else {
y += '';
}
x += addHtmlValue("Device Group", '');
- } else if (userid === 2) {
+ } else if (userid == 2) {
if (usergroups == null) return;
var y = '';
- for (var i in usergroups) { if ((currentMesh.links == null) || (currentMesh.links[i] == null)) { y += ''; } }
+ var ousergroups = getOrderedList(usergroups, 'name');
+ for (var i in ousergroups) { if ((currentMesh.links == null) || (currentMesh.links[ousergroups[i]._id] == null)) { y += ''; } }
x += addHtmlValue("User Group", '');
- } else if (userid === 6) {
+ } else if (userid == 6) {
if (usergroups == null) return;
var y = '';
if (selected == null) {
- for (var i in usergroups) { if ((currentNode.links == null) || (currentNode.links[i] == null)) { y += ''; } }
+ var ousergroups = getOrderedList(usergroups, 'name');
+ for (var i in ousergroups) { if ((currentNode.links == null) || (currentNode.links[ousergroups[i]._id] == null)) { y += ''; } }
} else {
y += '';
}
x += addHtmlValue("User Group", '');
- } else if (userid === 3) {
+ } else if (userid == 3) {
var y = '';
if (selected) { selected = decodeURIComponent(selected); }
- for (var i in meshes) { if ((selected != null) || (currentUserGroup.links == null) || (currentUserGroup.links[i] == null)) { y += ''; } }
- x += addHtmlValue("Device Group", '');
- } else if ((userid === 4) || (userid == 7)) {
+ var omeshs = getOrderedList(meshes, 'name');
+ for (var i in omeshs) { if ((selected != null) || (currentUserGroup.links == null) || (currentUserGroup.links[i] == null)) { y += ''; } }
+ x += addHtmlValue("Device Group", '');
+ } else if ((userid == 4) || (userid == 7)) {
var y = '', selectedMeshId = null, selectedNode = null;
if (selected != null) { selectedNode = getNodeFromId(decodeURIComponent(selected)); if (selectedNode != null) { selectedMeshId = selectedNode.meshid; } }
- for (var i in meshes) {
- if ((meshes[i].links[userinfo._id] != null) && (meshes[i].links[userinfo._id].rights & 7)) { // Only show device groups that we have user administrator for.
- if (selectedMeshId == null) { selectedMeshId = meshes[i]._id; } y += '';
+ var omeshs = getOrderedList(meshes, 'name');
+ for (var i in omeshs) {
+ if ((omeshs[i].links[userinfo._id] != null) && (omeshs[i].links[userinfo._id].rights & 7)) { // Only show device groups that we have user administrator for.
+ if (selectedMeshId == null) { selectedMeshId = omeshs[i]._id; } y += '';
}
}
x += addHtmlValue("Device Group", '');
y = '';
- for (var i in nodes) { if (nodes[i].meshid == selectedMeshId) { y += ''; } }
+ var onodes = getOrderedList(nodes, 'name');
+ for (var i in onodes) { if (onodes[i].meshid == selectedMeshId) { y += ''; } }
x += addHtmlValue("Device", '');
} else {
userid = decodeURIComponent(userid);
@@ -8726,11 +8736,11 @@
return false;
}
- function p20changeMeshAddMeshUserDialog() {
+ function p20changeMeshAddMeshUserDialog(userid) {
var y = '', meshid = decodeURIComponent(Q('dp2meshid').value);
for (var i in nodes) { if (nodes[i].meshid == meshid) { y += ''; } }
QH('dp2nodeid', y);
- p20validateAddMeshUserDialog(4);
+ p20validateAddMeshUserDialog(userid);
}
function p20setname(name) {
@@ -8749,6 +8759,7 @@
if (updateId === 4) {
// Update user device rights
var devrights = 0, nodeid = decodeURIComponent(Q('dp2nodeid').value);
+ console.log('nodeid', nodeid);
if ((nodeid != '') && (currentUser.links != null) && (currentUser.links[nodeid] != null)) { devrights = currentUser.links[nodeid].rights; }
Q('p20remotecontrol').checked = ((devrights & 8) != 0);
Q('p20meshagentconsole').checked = ((devrights & 16) != 0);
@@ -10103,7 +10114,7 @@
} else {
// Display the groups using the sorted list
x += '
';
- x += '
' + "Name" + '
' + "Devices" + '
' + "Device Groups" + '
' + "Users";
+ x += '
' + "Name" + '
' + "Users" + '
' + "Device Groups" + '
' + "Devices";
for (var i in sortedGroups) { x += addUserGroupHtml(sortedGroups[i]); }
x += '
';
QV('DuplicateUserGroupButton', true);
@@ -10127,7 +10138,7 @@
x += '';
x += '