mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-28 16:34:02 +03:00
Fixed OpenURL feature to only allow https:// or http://
This commit is contained in:
parent
adc513f08a
commit
7e58ebf54a
@ -2486,7 +2486,7 @@ function createMeshCore(agent) {
|
|||||||
|
|
||||||
// Open a web browser to a specified URL on current user's desktop
|
// Open a web browser to a specified URL on current user's desktop
|
||||||
function openUserDesktopUrl(url) {
|
function openUserDesktopUrl(url) {
|
||||||
if ((url.toLowerCase().startsWith('http://') == false) || (url.toLowerCase().startsWith('https://') == false)) { return null; }
|
if ((url.toLowerCase().startsWith('http://') == false) && (url.toLowerCase().startsWith('https://') == false)) { return null; }
|
||||||
var child = null;
|
var child = null;
|
||||||
try {
|
try {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6129,11 +6129,18 @@
|
|||||||
var wintype = false, linuxtype = false;
|
var wintype = false, linuxtype = false;
|
||||||
if (currentNode.agent) { if ((currentNode.agent.id > 0) && (currentNode.agent.id < 5)) { wintype = true; } else { linuxtype = true; } }
|
if (currentNode.agent) { if ((currentNode.agent.id > 0) && (currentNode.agent.id < 5)) { wintype = true; } else { linuxtype = true; } }
|
||||||
if ((wintype == true) || (linuxtype == true)) {
|
if ((wintype == true) || (linuxtype == true)) {
|
||||||
var x = "Run commands on this device." + '<br /><br />';
|
var x = "Run commands on selected devices." + '<br />';
|
||||||
if (wintype == true) { x += '<select id=d2cmdtype style=width:100%><option value=1>' + "Windows Command Prompt" + '</option><option value=2>' + "Windows PowerShell" + '</option></select>'; }
|
if (wintype == true) {
|
||||||
|
x += '<select id=d2cmdtype style=width:100%;margin-bottom:4px;margin-top:4px>';
|
||||||
|
x += '<option value=1>' + "Windows Command Prompt" + '</option><option value=2>' + "Windows PowerShell" + '</option>';
|
||||||
|
if (linuxtype == true) { x += '<option value=3>' + "Linux/BSD/macOS Command Shell" + '</option>'; }
|
||||||
|
x += '</select>';
|
||||||
|
}
|
||||||
|
x += '<select id=d2cmduser style=width:100%;margin-bottom:4px><option value=0>' + "Run as agent" + '</option><option value=1>' + "Run as user, agent if no user" + '</option><option value=2>' + "Must run as user" + '</option></select>';
|
||||||
x += '<textarea id=d2runcmd style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea>';
|
x += '<textarea id=d2runcmd style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea>';
|
||||||
setDialogMode(2, "Run Commands", 3, deviceRunCmdsFunctionEx, x);
|
setDialogMode(2, "Run Commands", 3, deviceRunCmdsFunctionEx, x);
|
||||||
Q('d2runcmd').focus();
|
Q('d2runcmd').focus();
|
||||||
|
//QE('idx_dlgOkButton', true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Power operation
|
// Power operation
|
||||||
@ -6142,9 +6149,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deviceRunCmdsFunctionEx() {
|
function deviceRunCmdsFunctionEx() {
|
||||||
var cmdType = 3;
|
var type = 3;
|
||||||
if ((currentNode.agent.id > 0) && (currentNode.agent.id < 5)) { cmdType = Q('d2cmdtype').value; }
|
try { type = parseInt(Q('d2cmdtype').value); } catch (ex) { }
|
||||||
meshserver.send({ action: 'runcommands', nodeids: [ currentNode._id ], type: parseInt(cmdType), cmds: Q('d2runcmd').value });
|
meshserver.send({ action: 'runcommands', nodeids: [ currentNode._id ], type: type, cmds: Q('d2runcmd').value, runAsUser: parseInt(Q('d2cmduser').value) });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when MeshCommander needs new credentials or updated credentials.
|
// Called when MeshCommander needs new credentials or updated credentials.
|
||||||
|
Loading…
Reference in New Issue
Block a user