Skip to content

Commit

Permalink
Fixed agent multicast, new nominify url option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylianst committed Aug 24, 2018
1 parent 1e7a39c commit f6b6fe9
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 38 deletions.
Binary file modified agents/MeshCmd-signed.exe
Binary file not shown.
Binary file modified agents/MeshCmd64-signed.exe
Binary file not shown.
Binary file modified agents/MeshService-signed.exe
Binary file not shown.
Binary file modified agents/MeshService.exe
Binary file not shown.
Binary file modified agents/MeshService64-signed.exe
Binary file not shown.
Binary file modified agents/MeshService64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.1.9-p",
"version": "0.1.9-q",
"keywords": [
"Remote Management",
"Intel AMT",
Expand Down
10 changes: 6 additions & 4 deletions public/compress.bat
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
@ECHO OFF
REM *** default.handlebars
REM *** Remove all old minified files
DEL ..\views\default-min.handlebars
DEL ..\views\default-mobile-min.handlebars
DEL ..\views\login-min.handlebars
DEL ..\views\login-mobile-min.handlebars

REM *** default.handlebars
COPY ..\views\default.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\default-min.handlebars
DEL compress.htm
DEL index.html

REM *** default-mobile.handlebars
DEL ..\views\default-mobile-min.handlebars
COPY ..\views\default-mobile.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\default-mobile-min.handlebars
DEL compress.htm
DEL index.html

REM *** login.handlebars
DEL ..\views\login-min.handlebars
COPY ..\views\login.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\login-min.handlebars
DEL compress.htm
DEL index.html

REM *** login-mobile.handlebars
DEL ..\views\login-mobile-min.handlebars
COPY ..\views\login-mobile.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\login-mobile-min.handlebars
Expand Down
1 change: 1 addition & 0 deletions sample-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"_MongoDbCol": "meshcentral",
"_WANonly": true,
"_LANonly": true,
"_Minify": 1,
"_SessionTime": 30,
"_SessionKey": "MyReallySecretPassword",
"_Port": 443,
Expand Down
2 changes: 1 addition & 1 deletion views/default-min.handlebars

Large diffs are not rendered by default.

51 changes: 27 additions & 24 deletions views/default.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,9 @@
var files;
var debugLevel = parseInt("{{{debuglevel}}}");
var features = parseInt("{{{features}}}");
var sessionTime = parseInt("{{{sessiontime}}}");
var domain = "{{{domain}}}";
var domainUrl = "{{{domainurl}}}";
var multiDesktop = {};
var multiDesktopFilter = null;
var serverPublicNamePort = "{{{serverDnsName}}}:{{{serverPublicPort}}}";
Expand Down Expand Up @@ -826,7 +829,7 @@
center();
// Connect to the mesh server
meshserver = MeshServerCreateControl("{{{domainurl}}}");
meshserver = MeshServerCreateControl(domainUrl);
meshserver.onStateChanged = onStateChanged;
meshserver.onMessage = onMessage;
meshserver.Start();
Expand Down Expand Up @@ -1173,13 +1176,13 @@
case 'accountremove': {
// An account was removed
if (users == null) break;
delete users['user/{{{domain}}}/' + message.event.username.toLowerCase()];
delete users['user/' + domain + '/' + message.event.username.toLowerCase()];
updateUsers();
break;
}
case 'createmesh': {
// A new mesh was created
if (message.event.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()] != null) { // Check if this is a mesh create for a mesh we own. If site administrator, we get all messages so need to ignore some.
if (message.event.links['user/' + domain + '/' + userinfo.name.toLowerCase()] != null) { // Check if this is a mesh create for a mesh we own. If site administrator, we get all messages so need to ignore some.
meshes[message.event.meshid] = { _id: message.event.meshid, name: message.event.name, mtype: message.event.mtype, desc: message.event.desc, links: message.event.links };
updateMeshes();
updateDevices();
Expand All @@ -1200,7 +1203,7 @@
meshes[message.event.meshid].links = message.event.links;
// Check if we lost rights to this mesh in this change.
if (meshes[message.event.meshid].links['user/{{{domain}}}/' + userinfo.name.toLowerCase()] == null) {
if (meshes[message.event.meshid].links['user/' + domain + '/' + userinfo.name.toLowerCase()] == null) {
if ((xxcurrentView == 20) && (currentMesh == meshes[message.event.meshid])) go(2);
delete meshes[message.event.meshid];
Expand Down Expand Up @@ -1338,10 +1341,10 @@
case 'wssessioncount': {
// Update the active web socket session count for a user
if (wssessions != null) {
if (message.event.count == 0 && wssessions['user/{{{domain}}}/' + message.event.username.toLowerCase()]) {
delete wssessions['user/{{{domain}}}/' + message.event.username.toLowerCase()];
if (message.event.count == 0 && wssessions['user/' + domain + '/' + message.event.username.toLowerCase()]) {
delete wssessions['user/' + domain + '/' + message.event.username.toLowerCase()];
} else {
wssessions['user/{{{domain}}}/' + message.event.username.toLowerCase()] = message.event.count;
wssessions['user/' + domain + '/' + message.event.username.toLowerCase()] = message.event.count;
}
updateUsers();
}
Expand All @@ -1354,7 +1357,7 @@
}
case 'login': {
// Update the last login time
if (users != null && users['user/{{{domain}}}/' + message.event.username.toLowerCase()]) { users['user/{{{domain}}}/' + message.event.username.toLowerCase()].login = message.event.time; }
if (users != null && users['user/' + domain + '/' + message.event.username.toLowerCase()]) { users['user/' + domain + '/' + message.event.username.toLowerCase()].login = message.event.time; }
break;
}
case 'scanamtdevice': {
Expand Down Expand Up @@ -1541,7 +1544,7 @@
// Go thru the list of nodes and display them
for (var i in nodes) {
if (nodes[i].v == false) continue;
var mesh2 = meshes[nodes[i].meshid], meshlinks = mesh2.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()];
var mesh2 = meshes[nodes[i].meshid], meshlinks = mesh2.links['user/' + domain + '/' + userinfo.name.toLowerCase()];
if (meshlinks == null) continue;
var meshrights = meshlinks.rights;
if ((view == 3) && (mesh2.mtype == 1)) continue;
Expand Down Expand Up @@ -1645,7 +1648,7 @@
// Display all empty meshes, we need to do this because users can add devices to these at any time.
if ((sort == 0) && (Q('SearchInput').value == '') && (view < 3)) {
for (var i in meshes) {
var mesh = meshes[i], meshlink = mesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()];
var mesh = meshes[i], meshlink = mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()];
if (meshlink != null) {
var meshrights = meshlink.rights;
if (displayedMeshes[mesh._id] == null) {
Expand Down Expand Up @@ -1747,7 +1750,7 @@
}
function toggleKvmDevice(nodeid) {
var node = getNodeFromId(nodeid), mesh = meshes[node.meshid], meshrights = mesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var node = getNodeFromId(nodeid), mesh = meshes[node.meshid], meshrights = mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
if ((meshrights & 8) != 0) { // Requires remote control rights
//var conn = 0;
//if ((node.conn & 1) != 0) { conn = 1; } else if ((node.conn & 6) != 0) { conn = 2; } // Check what type of connect we can do (Agent vs AMT)
Expand Down Expand Up @@ -2835,7 +2838,7 @@
function getNodeRights(nodeid) {
var node = getNodeFromId(nodeid), mesh = meshes[node.meshid];
return mesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
return mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
}
var currentNode;
Expand All @@ -2848,7 +2851,7 @@
//disconnectAllKvmFunction();
var node = getNodeFromId(nodeid);
var mesh = meshes[node.meshid];
var meshrights = mesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
if (!currentNode || currentNode._id != node._id || refresh == true) {
currentNode = node;
Expand Down Expand Up @@ -3067,7 +3070,7 @@
function deviceActionFunction() {
if (xxdialogMode) return;
var meshrights = meshes[currentNode.meshid].links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = meshes[currentNode.meshid].links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
var x = "Select an operation to perform on this device.<br /><br />";
var y = '<select id=d2deviceop style=float:right;width:250px>';
if ((meshrights & 64) != 0) { y += '<option value=100>Wake-up</option>'; } // Wake-up permission
Expand Down Expand Up @@ -3318,7 +3321,7 @@
function p10showiconselector() {
if (xxdialogMode) return;
var mesh = meshes[currentNode.meshid];
var meshrights = mesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
if ((meshrights & 4) == 0) return;
var x = '<br><div style=display:inline-block;width:40px></div>';
Expand Down Expand Up @@ -4437,7 +4440,7 @@
consoleNode = currentNode;
var mesh = meshes[consoleNode.meshid];
var meshrights = mesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
if ((meshrights & 16) != 0) {
if (consoleNode.consoleText == null) { consoleNode.consoleText = ''; }
if (samenode == false) {
Expand Down Expand Up @@ -4580,7 +4583,7 @@
function account_showDeleteAccount() {
if (xxdialogMode) return;
var x = "To delete this account, type in the account password in both boxes below and hit ok.<br /><br />";
x += "<form action='{{{domainurl}}}deleteaccount' method=post><table style=margin-left:80px><tr>";
x += "<form action='" + domainUrl + "deleteaccount' method=post><table style=margin-left:80px><tr>";
x += "<td align=right>Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";
x += "</tr><tr><td align=right>Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";
x += '</tr></table><br /><div style=padding:10px;margin-bottom:4px>';
Expand All @@ -4595,7 +4598,7 @@
function account_showChangePassword() {
if (xxdialogMode) return;
var x = "Change your account password by entering the new password twice in the boxes below.<br /><br />";
x += "<form action='{{{domainurl}}}changepassword' method=post><table style=margin-left:60px><tr>";
x += "<form action='" + domainUrl + "changepassword' method=post><table style=margin-left:60px><tr>";
x += "<td align=right>Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td>";
x += "</tr><tr><td align=right>Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() /></td>";
x += "</tr><tr><td align=right>Password Hint:</td><td><input id=apasswordhint name=apasswordhint maxlength=250 type=text autocomplete=off /></td>";
Expand Down Expand Up @@ -4660,7 +4663,7 @@
count++;
// Mesh rights
var meshrights = meshes[i].links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = meshes[i].links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
var rights = 'Partial Rights';
if (meshrights == 0xFFFFFFFF) rights = 'Full Administrator'; else if (meshrights == 0) rights = 'No Rights';
Expand Down Expand Up @@ -4713,7 +4716,7 @@
if (currentMesh == null) return;
QH('p20meshName', EscapeHtml(currentMesh.name));
var meshtype = 'Unknown #' + currentMesh.mtype;
var meshrights = currentMesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = currentMesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
if (currentMesh.mtype == 1) meshtype = 'Intel&reg; AMT computer group (No Agent)';
if (currentMesh.mtype == 2) meshtype = 'Mesh agent computer group';
Expand All @@ -4726,7 +4729,7 @@
x += '<br><input type=button value=Notes title="View notes about this mesh" onclick=showNotes(false,"' + encodeURIComponent(currentMesh._id) + '") />';
x += '<br style=clear:both><br>';
var currentMeshLinks = currentMesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()];
var currentMeshLinks = currentMesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()];
if (currentMeshLinks && ((currentMeshLinks.rights & 2) != 0)) { x += '<a onclick=p20showAddMeshUserDialog() style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Add User</a>'; }
if ((meshrights & 4) != 0) {
Expand Down Expand Up @@ -4834,7 +4837,7 @@
}
function p20validateAddMeshUserDialog() {
var meshrights = currentMesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
var meshrights = currentMesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights;
QE('idx_dlgOkButton', (Q('dp20username').value.length > 0));
QE('p20fulladmin', meshrights == 0xFFFFFFFF);
QE('p20editmesh', (!Q('p20fulladmin').checked) && (meshrights == 0xFFFFFFFF));
Expand Down Expand Up @@ -4865,7 +4868,7 @@
function p20viewuser(userid) {
if (xxdialogMode) return;
userid = decodeURIComponent(userid);
var r = '', cmeshrights = currentMesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights, meshrights = currentMesh.links[userid].rights;
var r = '', cmeshrights = currentMesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()].rights, meshrights = currentMesh.links[userid].rights;
if (meshrights == 0xFFFFFFFF) r = ', Full Administrator (all rights)'; else {
if ((meshrights & 1) != 0) r += ', Edit Mesh';
if ((meshrights & 2) != 0) r += ', Manage Mesh Users';
Expand All @@ -4880,7 +4883,7 @@
if (r == '') { r = 'No Rights'; }
var buttons = 1, x = addHtmlValue('User Name', userid.split('/')[2]);
x += addHtmlValue('Permissions', r);
if ((('user/{{{domain}}}/' + userinfo.name.toLowerCase()) != userid) && (cmeshrights == 0xFFFFFFFF || (((cmeshrights & 2) != 0) && (meshrights != 0xFFFFFFFF)))) buttons += 4;
if ((('user/' + domain + '/' + userinfo.name.toLowerCase()) != userid) && (cmeshrights == 0xFFFFFFFF || (((cmeshrights & 2) != 0) && (meshrights != 0xFFFFFFFF)))) buttons += 4;
setDialogMode(2, "Mesh User", buttons, p20viewuserEx, x, userid);
}
Expand Down
Loading

0 comments on commit f6b6fe9

Please sign in to comment.