Internationalized RDP login page and added 3FA support.

This commit is contained in:
Ylian Saint-Hilaire 2020-06-12 13:56:29 -07:00
parent 89e126b976
commit 1f61bc7c2b
7 changed files with 30 additions and 32 deletions

View File

@ -572,6 +572,7 @@
<Content Include="views\login.handlebars" />
<Content Include="views\message.handlebars" />
<Content Include="views\messenger.handlebars" />
<Content Include="views\mstsc.handlebars" />
<Content Include="views\terms-mobile.handlebars" />
<Content Include="views\terms.handlebars" />
<Content Include="views\xterm.handlebars" />

View File

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script language="javascript">
function install() {
// bind keyboard event
window.addEventListener('keydown', function (e) {
document.getElementById('output').innerHTML += e.keyCode + ' : "' + e.code + '", <br>';
e.preventDefault();
return false;
});
}
</script>
</head>
<body onload='install()'>
<p id='output'></p>
</body>
</html>

View File

@ -32,6 +32,7 @@ var meshCentralSourceFiles = [
"../views/message.handlebars",
"../views/messenger.handlebars",
"../views/player.handlebars",
"../views/mstsc.handlebars",
"../emails/account-check.html",
"../emails/account-invite.html",
"../emails/account-login.html",
@ -61,6 +62,7 @@ var minifyMeshCentralSourceFiles = [
"../views/message.handlebars",
"../views/messenger.handlebars",
"../views/player.handlebars",
"../views/mstsc.handlebars",
"../public/scripts/agent-desktop-0.0.2.js",
"../public/scripts/agent-redir-rtc-0.1.0.js",
"../public/scripts/agent-redir-ws-0.1.1.js",

View File

@ -6318,6 +6318,7 @@
"default.handlebars->container->column_l->p11->deskarea0->deskarea1->3->connectbutton1span",
"default.handlebars->container->column_l->p12->termTable->1->1->0->1->3->connectbutton2span",
"default.handlebars->container->column_l->p13->p13toolbar->1->0->1->3",
"mstsc.handlebars->main->1->3->1->8->1->0",
"xterm.handlebars->p11->deskarea0->deskarea1->3"
]
},
@ -8852,7 +8853,9 @@
"default.handlebars->27->1487",
"default.handlebars->27->1533",
"default.handlebars->27->1542",
"default.handlebars->27->1597"
"default.handlebars->27->1597",
"mstsc.handlebars->main->1->3->1->2->1->0",
"mstsc.handlebars->main->1->3->1->2->3"
]
},
{
@ -19679,7 +19682,9 @@
"default.handlebars->27->1661",
"default.handlebars->27->251",
"default.handlebars->27->280",
"default.handlebars->27->645"
"default.handlebars->27->645",
"mstsc.handlebars->main->1->3->1->6->1->0",
"mstsc.handlebars->main->1->3->1->6->3"
]
},
{
@ -27999,6 +28004,8 @@
"default.handlebars->27->249",
"default.handlebars->27->279",
"default.handlebars->27->644",
"mstsc.handlebars->main->1->3->1->4->1->0",
"mstsc.handlebars->main->1->3->1->4->3",
"player.handlebars->3->4"
]
},

View File

@ -2208,13 +2208,13 @@
newWindow.opener = null;
}
} else if (message.tag == 'novnc') {
var vncurl = window.location.origin + domainUrl + 'novnc/vnc.html?ws=wss%3A%2F%2F' + window.location.host + '%2Fmeshrelay.ashx%3Fauth%3D' + message.cookie + '&show_dot=1';
var vncurl = window.location.origin + domainUrl + 'novnc/vnc.html?ws=wss%3A%2F%2F' + window.location.host + '%2Fmeshrelay.ashx%3Fauth%3D' + message.cookie + '&show_dot=1' + (urlargs.key?('&key=' + urlargs.key):'');
var node = getNodeFromId(message.nodeid);
if (node != null) { vncurl += '&name=' + encodeURIComponentEx(node.name); }
var newWindow = window.open(vncurl, 'mcnovnc/' + message.nodeid);
newWindow.opener = null;
} else if (message.tag == 'mstsc') {
var rdpurl = window.location.origin + domainUrl + 'mstsc/index.html?ws=' + message.cookie;
var rdpurl = window.location.origin + domainUrl + 'mstsc.html?ws=' + message.cookie + (urlargs.key?('&key=' + urlargs.key):'');
var node = getNodeFromId(message.nodeid);
if (node != null) { rdpurl += '&name=' + encodeURIComponentEx(node.name); }
var newWindow = window.open(rdpurl, 'mcmstsc/' + message.nodeid);

View File

@ -6,16 +6,15 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/favicon.ico">
<title>RDP</title>
<script type="text/javascript" src="mstsc.js"></script>
<script type="text/javascript" src="keyboard.js"></script>
<script type="text/javascript" src="rle.js"></script>
<script type="text/javascript" src="client.js"></script>
<script type="text/javascript" src="canvas.js"></script>
<script type="text/javascript" src="mstsc/mstsc.js"></script>
<script type="text/javascript" src="mstsc/keyboard.js"></script>
<script type="text/javascript" src="mstsc/rle.js"></script>
<script type="text/javascript" src="mstsc/client.js"></script>
<script type="text/javascript" src="mstsc/canvas.js"></script>
<style>
body {
font-family:sans-serif;
margin: 0;
xoverflow: hidden;
background-color: black;
}
@ -35,14 +34,14 @@
}
.signinform {
width: 330px;
width: 380px;
margin: 0 auto;
}
.formLabel { }
.formControl {
width: 210px;
width:calc(100% - 16px);
font-size: 17px;
border-radius: 5px;
}

View File

@ -1627,6 +1627,14 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
render(req, res, getRenderPage('invite', req, domain), getRenderArgs({ messageid: 100 }, req, domain)); // Bad invitation code
}
// Called to render the MSTSC (RDP) web page
function handleMSTSCRequest(req, res) {
const domain = getDomain(req);
if (domain == null) { parent.debug('web', 'handleMSTSCRequest: failed checks.'); res.sendStatus(404); return; }
if ((domain.loginkey != null) && (domain.loginkey.indexOf(req.query.key) == -1)) { res.sendStatus(404); return; } // Check 3FA URL key
render(req, res, getRenderPage('mstsc', req, domain), getRenderArgs({}, req, domain));
}
// Called to process an agent invite request
function handleAgentInviteRequest(req, res) {
const domain = getDomain(req);
@ -4350,6 +4358,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
// Setup MSTSC.js if needed
if (domain.mstsc === true) {
obj.app.get(url + 'mstsc.html', handleMSTSCRequest);
obj.app.ws(url + 'mstsc/relay.ashx', function (ws, req) {
PerformWSSessionAuth(ws, req, false, function (ws1, req1, domain, user) {
require('./mstsc.js').CreateMstscRelay(obj, obj.db, ws1, req1, obj.args, domain, user);