mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-11 15:03:20 -05:00
Now saves alternative RDP port to server.
This commit is contained in:
parent
40c6cdc88a
commit
e02c3f7672
@ -2740,6 +2740,13 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
if (command.icon && (command.icon != node.icon)) { change = 1; node.icon = command.icon; changes.push('icon'); }
|
if (command.icon && (command.icon != node.icon)) { change = 1; node.icon = command.icon; changes.push('icon'); }
|
||||||
if (command.name && (command.name != node.name)) { change = 1; node.name = command.name; changes.push('name'); }
|
if (command.name && (command.name != node.name)) { change = 1; node.name = command.name; changes.push('name'); }
|
||||||
if (command.host && (command.host != node.host)) { change = 1; node.host = command.host; changes.push('host'); }
|
if (command.host && (command.host != node.host)) { change = 1; node.host = command.host; changes.push('host'); }
|
||||||
|
if ((typeof command.rdpport == 'number') && (command.rdpport > 0) && (command.rdpport < 65536)) {
|
||||||
|
if ((command.rdpport == 3389) && (node.rdpport != null)) {
|
||||||
|
delete node.rdpport; change = 1; changes.push('rdpport'); // Delete the RDP port
|
||||||
|
} else {
|
||||||
|
node.rdpport = command.rdpport; change = 1; changes.push('rdpport'); // Set the RDP port
|
||||||
|
}
|
||||||
|
}
|
||||||
if (domain.geolocation && command.userloc && ((node.userloc == null) || (command.userloc[0] != node.userloc[0]) || (command.userloc[1] != node.userloc[1]))) {
|
if (domain.geolocation && command.userloc && ((node.userloc == null) || (command.userloc[0] != node.userloc[0]) || (command.userloc[1] != node.userloc[1]))) {
|
||||||
change = 1;
|
change = 1;
|
||||||
if ((command.userloc.length == 0) && (node.userloc)) {
|
if ((command.userloc.length == 0) && (node.userloc)) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meshcentral",
|
"name": "meshcentral",
|
||||||
"version": "0.4.9-h",
|
"version": "0.4.9-i",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Remote Management",
|
"Remote Management",
|
||||||
"Intel AMT",
|
"Intel AMT",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1060,6 +1060,7 @@
|
|||||||
node.gpsloc = message.event.node.gpsloc;
|
node.gpsloc = message.event.node.gpsloc;
|
||||||
node.tags = message.event.node.tags;
|
node.tags = message.event.node.tags;
|
||||||
node.userloc = message.event.node.userloc;
|
node.userloc = message.event.node.userloc;
|
||||||
|
node.rdpport = message.event.node.rdpport;
|
||||||
if (message.event.node.agent != null) {
|
if (message.event.node.agent != null) {
|
||||||
if (node.agent == null) node.agent = {};
|
if (node.agent == null) node.agent = {};
|
||||||
if (message.event.node.agent.ver != null) { node.agent.ver = message.event.node.agent.ver; }
|
if (message.event.node.agent.ver != null) { node.agent.ver = message.event.node.agent.ver; }
|
||||||
|
@ -2456,6 +2456,7 @@
|
|||||||
node.gpsloc = message.event.node.gpsloc;
|
node.gpsloc = message.event.node.gpsloc;
|
||||||
node.tags = message.event.node.tags;
|
node.tags = message.event.node.tags;
|
||||||
node.userloc = message.event.node.userloc;
|
node.userloc = message.event.node.userloc;
|
||||||
|
node.rdpport = message.event.node.rdpport;
|
||||||
if (message.event.node.agent != null) {
|
if (message.event.node.agent != null) {
|
||||||
if (node.agent == null) node.agent = {};
|
if (node.agent == null) node.agent = {};
|
||||||
if (message.event.node.agent.ver != null) { node.agent.ver = message.event.node.agent.ver; }
|
if (message.event.node.agent.ver != null) { node.agent.ver = message.event.node.agent.ver; }
|
||||||
@ -4001,6 +4002,7 @@
|
|||||||
function handleContextMenu(event) {
|
function handleContextMenu(event) {
|
||||||
// When called, we look for elements with "cmenu=xxx" and show the right context menu for that element.
|
// When called, we look for elements with "cmenu=xxx" and show the right context menu for that element.
|
||||||
hideContextMenu();
|
hideContextMenu();
|
||||||
|
if (xxdialogMode) return;
|
||||||
var scrollLeft = (window.pageXOffset !== null) ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft;
|
var scrollLeft = (window.pageXOffset !== null) ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft;
|
||||||
var scrollTop = (window.pageYOffset !== null) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
var scrollTop = (window.pageYOffset !== null) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
||||||
var elem = document.elementFromPoint(event.pageX - scrollLeft, event.pageY - scrollTop);
|
var elem = document.elementFromPoint(event.pageX - scrollLeft, event.pageY - scrollTop);
|
||||||
@ -4112,9 +4114,13 @@
|
|||||||
var x = "RDP remote connection port:" + '<br /><br /><input type=text placeholder="3389" inputmode="numeric" pattern="[0-9]*" onkeypress=\"return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)\" maxlength=5 id=d10rdpport type=text>';
|
var x = "RDP remote connection port:" + '<br /><br /><input type=text placeholder="3389" inputmode="numeric" pattern="[0-9]*" onkeypress=\"return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)\" maxlength=5 id=d10rdpport type=text>';
|
||||||
setDialogMode(2, "RDP Connection", 3, function() {
|
setDialogMode(2, "RDP Connection", 3, function() {
|
||||||
setDialogMode(0);
|
setDialogMode(0);
|
||||||
if (currentNode != null) { p10clickOnce(currentNode._id, "RDP2", ((Q('d10rdpport').value.length > 0) ? parseInt(Q('d10rdpport').value) : 3389)); }
|
// Save the new RDP port to the server
|
||||||
|
var rdpport = ((Q('d10rdpport').value.length > 0) ? parseInt(Q('d10rdpport').value) : 3389);
|
||||||
|
meshserver.send({ action: 'changedevice', nodeid: currentNode._id, rdpport: rdpport });
|
||||||
|
if (currentNode != null) { p10clickOnce(currentNode._id, 'RDP2', rdpport); }
|
||||||
}, x, currentNode);
|
}, x, currentNode);
|
||||||
Q('d10rdpport').focus();
|
Q('d10rdpport').focus();
|
||||||
|
if (currentNode.rdpport != null) { Q('d10rdpport').value = currentNode.rdpport; }
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmfilesaction(action) {
|
function cmfilesaction(action) {
|
||||||
@ -4980,7 +4986,7 @@
|
|||||||
|
|
||||||
// RDP link, show this link only of the remote machine is Windows.
|
// RDP link, show this link only of the remote machine is Windows.
|
||||||
if (((connectivity & 1) != 0) && (clickOnce == true) && (mesh.mtype == 2) && ((meshrights & 8) != 0)) {
|
if (((connectivity & 1) != 0) && (clickOnce == true) && (mesh.mtype == 2) && ((meshrights & 8) != 0)) {
|
||||||
if ((node.agent.id > 0) && (node.agent.id < 5)) { x += '<a href=# cmenu=altPortContextMenu id=rdpClickOnceLink onclick=p10clickOnce("' + node._id + '","RDP2",3389) title=\"' + "Requires Microsoft ClickOnce support in your browser" + '.\">' + "RDP" + '</a> '; }
|
if ((node.agent.id > 0) && (node.agent.id < 5)) { x += '<a href=# cmenu=altPortContextMenu id=rdpClickOnceLink onclick=p10clickOnce("' + node._id + '","RDP2") title=\"' + "Requires Microsoft ClickOnce support in your browser" + '.\">' + "RDP" + '</a> '; }
|
||||||
if (node.agent.id > 4) {
|
if (node.agent.id > 4) {
|
||||||
x += '<a href=# onclick=p10clickOnce("' + node._id + '","PSSH",22) title=\"' + "Requires Microsoft ClickOnce support in your browser." + '\">' + "Putty" + '</a> ';
|
x += '<a href=# onclick=p10clickOnce("' + node._id + '","PSSH",22) title=\"' + "Requires Microsoft ClickOnce support in your browser." + '\">' + "Putty" + '</a> ';
|
||||||
x += '<a href=# onclick=p10clickOnce("' + node._id + '","WSCP",22) title=\"' + "Requires Microsoft ClickOnce support in your browser." + '\">' + "WinSCP" + '</a> ';
|
x += '<a href=# onclick=p10clickOnce("' + node._id + '","WSCP",22) title=\"' + "Requires Microsoft ClickOnce support in your browser." + '\">' + "WinSCP" + '</a> ';
|
||||||
@ -5374,6 +5380,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function p10clickOnce(nodeid, protocol, port) {
|
function p10clickOnce(nodeid, protocol, port) {
|
||||||
|
if ((protocol == 'RDP2') && (port == null)) { if (currentNode.rdpport != null) { port = currentNode.rdpport; } else { port = 3389; } }
|
||||||
meshserver.send({ action: 'getcookie', nodeid: nodeid, tcpport: port, tag: 'clickonce', protocol: protocol });
|
meshserver.send({ action: 'getcookie', nodeid: nodeid, tcpport: port, tag: 'clickonce', protocol: protocol });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user