Minor fixes.

This commit is contained in:
Ylian Saint-Hilaire 2019-02-12 13:37:01 -08:00
parent 518d4d1017
commit 027a9944f5
5 changed files with 9 additions and 6 deletions

View File

@ -342,8 +342,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
// If the mesh agent web socket is closed, clean up.
ws.on('close', function (req) {
if (obj.nodeid != null) {
//console.log('Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + obj.agentInfo.agentId);
obj.parent.parent.debug(1, 'Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + obj.agentInfo.agentId);
var agentId = 'Unknown';
if (obj.agentInfo && obj.agentInfo.agentId) { agentId = obj.agentInfo.agentId; }
//console.log('Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + agentId);
obj.parent.parent.debug(1, 'Agent disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ') id=' + agentId);
// Log the agent disconnection
if (obj.parent.wsagentsDisconnections[obj.nodeid] == null) {

View File

@ -130,7 +130,7 @@ module.exports.CreateMeshMail = function (parent) {
// Set all the options.
var options = { username: username, email: email, servername: domain.title };
options.cookie = obj.parent.encodeCookie({ u: domain.id + '/' + username, e: email, a: 1 }, obj.mailCookieEncryptionKey);
options.cookie = obj.parent.encodeCookie({ u: domain.id + '/' + username.toLowerCase(), e: email, a: 1 }, obj.mailCookieEncryptionKey);
// Send the email
obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) });

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.2.7-y",
"version": "0.2.8-b",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -62,6 +62,7 @@
}
},
"_letsencrypt": {
"__comment__": "If your are having problems with Let's Encrypt, use https://letsdebug.net/ first to debug it.",
"email": "myemail@myserver.com ",
"names": "myserver.com,customer1.myserver.com",
"rsaKeySize": 3072,

View File

@ -639,9 +639,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if ((idsplit.length != 2) || (idsplit[0] != domain.id)) {
res.render(obj.path.join(obj.parent.webViewsPath, 'message'), { title: domain.title, title2: domain.title2, title3: 'Account Verification', message: 'ERROR: Invalid domain. <a href="' + domain.url + '">Go to login page</a>.' });
} else {
obj.db.Get('user/' + cookie.u, function (err, docs) {
obj.db.Get('user/' + cookie.u.toLowerCase(), function (err, docs) {
if (docs.length == 0) {
res.render(obj.path.join(obj.parent.webViewsPath, 'message'), { title: domain.title, title2: domain.title2, title3: 'Account Verification', message: 'ERROR: Invalid username \"' + EscapeHtml(cookie.u) + '\". <a href="' + domain.url + '">Go to login page</a>.' });
res.render(obj.path.join(obj.parent.webViewsPath, 'message'), { title: domain.title, title2: domain.title2, title3: 'Account Verification', message: 'ERROR: Invalid username \"' + EscapeHtml(idsplit[1]) + '\". <a href="' + domain.url + '">Go to login page</a>.' });
} else {
var user = docs[0];
if (user.email != cookie.e) {