More device rights fixes.

This commit is contained in:
Ylian Saint-Hilaire 2020-03-30 13:29:06 -07:00
parent 6639d843ef
commit 27ad66831e
3 changed files with 22 additions and 21 deletions

View File

@ -217,10 +217,7 @@
"nl": " Gebruiker toevoegen",
"pt": " Adicionar usuário",
"ru": " Добавить пользователя",
"zh-chs": " 添加用戶",
"xloc": [
"default-mobile.handlebars->9->284"
]
"zh-chs": " 添加用戶"
},
{
"cs": " Je možné zadat i nápovědu pro heslo, ale nedoporučuje se to.",
@ -2423,6 +2420,7 @@
"ru": "Добавить пользователя",
"zh-chs": "添加用戶",
"xloc": [
"default-mobile.handlebars->9->284",
"default.handlebars->27->531"
]
},
@ -24822,8 +24820,8 @@
]
},
{
"en": "User Permissions"
"en": "Gebruikersrechten"
"en": "User Permissions",
"nl": "Gebruikersrechten"
},
{
"cs": "PowerShell uživatele",
@ -27786,4 +27784,4 @@
]
}
]
}
}

View File

@ -797,7 +797,7 @@
for (var n in message.nodes[m]) {
message.nodes[m][n].namel = message.nodes[m][n].name.toLowerCase();
if (message.nodes[m][n].rname) { message.nodes[m][n].rnamel = message.nodes[m][n].rname.toLowerCase(); } else { message.nodes[m][n].rnamel = message.nodes[m][n].namel; }
if (meshes[m]) { message.nodes[m][n].meshnamel = meshes[m].name.toLowerCase(); }
message.nodes[m][n].meshnamel = meshes[m]?meshes[m].name.toLowerCase():'*';
message.nodes[m][n].meshid = m;
message.nodes[m][n].state = (message.nodes[m][n].state) ? (message.nodes[m][n].state) : 0;
message.nodes[m][n].desc = message.nodes[m][n].desc;
@ -1029,7 +1029,7 @@
if (getNodeFromId(node._id) != null) break; // This node is already known.
node.namel = node.name.toLowerCase();
if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
node.meshnamel = meshes[node.meshid].name.toLowerCase();
node.meshnamel = meshes[node.meshid]?meshes[node.meshid].name.toLowerCase():'*';
node.state = 0;
if (!node.icon) node.icon = 1;
node.ident = ++nodeShortIdent;
@ -1121,7 +1121,7 @@
} else {
// We see the new mesh, move this device
node.meshid = message.event.newMeshId;
node.meshnamel = meshes[message.event.newMeshId].name.toLowerCase();
node.meshnamel = meshes[message.event.newMeshId]?meshes[message.event.newMeshId].name.toLowerCase():'*';
}
updateDevices();
refreshDevice(message.event.nodeid);
@ -1131,7 +1131,7 @@
if (!meshes[node.meshid]) break; // This is a node for a mesh we don't know. Happens when we are site administrator, we get all messages.
node.namel = node.name.toLowerCase();
if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
node.meshnamel = meshes[node.meshid].name.toLowerCase();
node.meshnamel = meshes[node.meshid]?meshes[node.meshid].name.toLowerCase():'*';
node.state = 0;
if (!node.icon) node.icon = 1;
node.ident = ++nodeShortIdent;
@ -1751,7 +1751,8 @@
if (sort == 0) {
// Mesh header
nodes.sort(meshSort);
if (nodes[i].meshid != current) {
//if (nodes[i].meshid != current) {
if (((meshes[nodes[i].meshid]?nodes[i].meshid:'*') != current)) {
deviceHeaderSet();
var extra = '';
if ((meshes[nodes[i].meshid] != null) && (meshes[nodes[i].meshid].mtype == 1)) { extra = '<span style=color:lightgray>' + ", Intel&reg; AMT only" + '</span>'; }
@ -1761,11 +1762,12 @@
if (meshes[nodes[i].meshid]) {
r += '</span><span id=MxMESH style=cursor:pointer onclick=goForward("' + nodes[i].meshid + '")>' + EscapeHtml(meshes[nodes[i].meshid].name) + '</span>' + extra + '<span id=DevxHeader' + deviceHeaderId + ' style=color:lightgray></span></div>';
current = nodes[i].meshid;
} else {
r += '</span><span id=MxMESH style=cursor:pointer>' + "Indivitual Devices" + '</span>' + extra + '<span id=DevxHeader' + deviceHeaderId + ' style=color:lightgray></span></div>';
r += '</span><span id=MxMESH style=cursor:pointer><i>' + "Indivitual Devices" + '</i></span>' + extra + '<span id=DevxHeader' + deviceHeaderId + ' style=color:lightgray></span></div>';
current = '*';
}
current = nodes[i].meshid;
displayedMeshes[current] = 1;
c = 0;
}
@ -3196,7 +3198,7 @@
x += '<br style=clear:both><br>';
var currentMeshLinks = currentMesh.links[userinfo._id];
if (currentMeshLinks && ((currentMeshLinks.rights & 2) != 0)) { x += '<div style=margin-bottom:6px><a onclick=p20showAddMeshUserDialog() style=cursor:pointer><img src=images/icon-addnew.png border=0 height=12 width=12>' + " Add User" + '</a></div>'; }
if (currentMeshLinks && ((currentMeshLinks.rights & 2) != 0)) { x += '<div style=margin-bottom:6px><a onclick=p20showAddMeshUserDialog() style=cursor:pointer><img src=images/icon-addnew.png border=0 height=12 width=12> ' + "Add User" + '</a></div>'; }
/*
if ((meshrights & 4) != 0) {

View File

@ -1818,7 +1818,7 @@
if (message.nodes[m][n]._id == null) { console.log('Invalid node (' + n + '): ' + JSON.stringify(message.nodes)); continue; }
message.nodes[m][n].namel = message.nodes[m][n].name.toLowerCase();
if (message.nodes[m][n].rname) { message.nodes[m][n].rnamel = message.nodes[m][n].rname.toLowerCase(); } else { message.nodes[m][n].rnamel = message.nodes[m][n].namel; }
if (meshes[m]) { message.nodes[m][n].meshnamel = meshes[m].name.toLowerCase(); }
message.nodes[m][n].meshnamel = meshes[m]?meshes[m].name.toLowerCase():'*';
message.nodes[m][n].meshid = m;
message.nodes[m][n].state = (message.nodes[m][n].state)?(message.nodes[m][n].state):0;
if (!message.nodes[m][n].icon) message.nodes[m][n].icon = 1;
@ -2377,7 +2377,7 @@
if (getNodeFromId(node._id) != null) break; // This node is already known.
node.namel = node.name.toLowerCase();
if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
node.meshnamel = meshes[node.meshid].name.toLowerCase();
node.meshnamel = meshes[node.meshid]?meshes[node.meshid].name.toLowerCase():'*';
node.state = 0;
if (!node.icon) node.icon = 1;
node.ident = ++nodeShortIdent;
@ -2475,7 +2475,7 @@
} else {
// We see the new mesh, move this device
node.meshid = message.event.newMeshId;
node.meshnamel = meshes[message.event.newMeshId].name.toLowerCase();
node.meshnamel = meshes[message.event.newMeshId]?meshes[message.event.newMeshId].name.toLowerCase():'*';
masterUpdate(1 | 2 | 4);
}
refreshDevice(message.event.nodeid);
@ -2485,7 +2485,7 @@
if (!meshes[node.meshid]) break; // This is a node for a mesh we don't know. Happens when we are site administrator, we get all messages.
node.namel = node.name.toLowerCase();
if (node.rname) { node.rnamel = node.rname.toLowerCase(); } else { node.rnamel = node.namel; }
node.meshnamel = meshes[node.meshid].name.toLowerCase();
node.meshnamel = meshes[node.meshid]?meshes[node.meshid].name.toLowerCase():'*';
node.state = 0;
if (!node.icon) node.icon = 1;
node.ident = ++nodeShortIdent;
@ -2975,7 +2975,7 @@
var meshrights = GetNodeRights(node);
if (sort == 0) {
// Mesh header
if (node.meshid != current) {
if (((meshes[node.meshid]?node.meshid:'*') != current)) {
if (((view == 1) || (view == 3)) && (current != null)) { r += '</div>'; } // Close collapse div
deviceHeaderSet();
var extra = '';
@ -2992,11 +2992,12 @@
}
if (meshes[node.meshid]) {
r += '<span id=MxMESH cmenu=meshContextMenu tabindex=0 style=cursor:pointer onclick=gotoMesh("' + node.meshid + '") onkeypress="if (event.key==\'Enter\') gotoMesh(\'' + node.meshid + '\')">' + EscapeHtml(meshes[node.meshid].name) + '</span>' + getMeshActions(mesh2, meshrights) + '</div>';
current = node.meshid;
} else {
r += '<span id=MxMESH cmenu=meshContextMenu tabindex=0 style=cursor:pointer><i>' + "Indivitual Devices" + '</i></span></div>';
current = '*';
}
if (view == 2) { r += '</div>'; }
current = node.meshid;
displayedMeshes[current] = 1;
c = 0;
if ((view == 1) || (view == 3)) { r += '<div id=DevxCol' + deviceHeaderId + ((collapsed === true)?' style=display:none':'') + '>'; } // Open collapse div