Fixed agent multicast, new nominify url option.

This commit is contained in:
Ylian Saint-Hilaire 2018-08-24 13:14:20 -07:00
parent 1e7a39c631
commit f6b6fe9506
12 changed files with 44 additions and 38 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.1.9-p", "version": "0.1.9-q",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",

View File

@ -1,6 +1,11 @@
@ECHO OFF @ECHO OFF
REM *** default.handlebars REM *** Remove all old minified files
DEL ..\views\default-min.handlebars 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 COPY ..\views\default.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c ..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\default-min.handlebars COPY compress.htm ..\views\default-min.handlebars
@ -8,7 +13,6 @@ DEL compress.htm
DEL index.html DEL index.html
REM *** default-mobile.handlebars REM *** default-mobile.handlebars
DEL ..\views\default-mobile-min.handlebars
COPY ..\views\default-mobile.handlebars index.html COPY ..\views\default-mobile.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c ..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\default-mobile-min.handlebars COPY compress.htm ..\views\default-mobile-min.handlebars
@ -16,7 +20,6 @@ DEL compress.htm
DEL index.html DEL index.html
REM *** login.handlebars REM *** login.handlebars
DEL ..\views\login-min.handlebars
COPY ..\views\login.handlebars index.html COPY ..\views\login.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c ..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\login-min.handlebars COPY compress.htm ..\views\login-min.handlebars
@ -24,7 +27,6 @@ DEL compress.htm
DEL index.html DEL index.html
REM *** login-mobile.handlebars REM *** login-mobile.handlebars
DEL ..\views\login-mobile-min.handlebars
COPY ..\views\login-mobile.handlebars index.html COPY ..\views\login-mobile.handlebars index.html
..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c ..\..\WebSiteCompiler\bin\Debug\WebSiteCompiler.exe compress.wcc -c
COPY compress.htm ..\views\login-mobile-min.handlebars COPY compress.htm ..\views\login-mobile-min.handlebars

View File

@ -5,6 +5,7 @@
"_MongoDbCol": "meshcentral", "_MongoDbCol": "meshcentral",
"_WANonly": true, "_WANonly": true,
"_LANonly": true, "_LANonly": true,
"_Minify": 1,
"_SessionTime": 30, "_SessionTime": 30,
"_SessionKey": "MyReallySecretPassword", "_SessionKey": "MyReallySecretPassword",
"_Port": 443, "_Port": 443,

File diff suppressed because one or more lines are too long

View File

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

View File

@ -722,17 +722,17 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if ((!obj.args.user) && (obj.args.nousers != true) && (nologout == false)) { logoutcontrol += ' <a href=' + domain.url + 'logout?' + Math.random() + ' style=color:white>Logout</a>'; } // If a default user is in use or no user mode, don't display the logout button if ((!obj.args.user) && (obj.args.nousers != true) && (nologout == false)) { logoutcontrol += ' <a href=' + domain.url + 'logout?' + Math.random() + ' style=color:white>Logout</a>'; } // If a default user is in use or no user mode, don't display the logout button
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
if (obj.args.minify) { if (obj.args.minify && !req.query.nominify) {
// Try to server the minified version if we can. // Try to server the minified version if we can.
try { try {
res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/default-mobile-min' : 'views/default-min'), { viewmode: viewmode, currentNode: currentNode, logoutControl: logoutcontrol, title: domain.title, title2: domain.title2, domainurl: domain.url, domain: domain.id, debuglevel: parent.debugLevel, serverDnsName: getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, noServerBackup: (args.noserverbackup == 1 ? 1 : 0), features: features, mpspass: args.mpspass, webcerthash: obj.webCertificateHashBase64, footer: (domain.footer == null) ? '' : domain.footer }); res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/default-mobile-min' : 'views/default-min'), { viewmode: viewmode, currentNode: currentNode, logoutControl: logoutcontrol, title: domain.title, title2: domain.title2, domainurl: domain.url, domain: domain.id, debuglevel: parent.debugLevel, serverDnsName: getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, noServerBackup: (args.noserverbackup == 1 ? 1 : 0), features: features, sessiontime: args.sessiontime, mpspass: args.mpspass, webcerthash: obj.webCertificateHashBase64, footer: (domain.footer == null) ? '' : domain.footer });
} catch (ex) { } catch (ex) {
// In case of an exception, serve the non-minified version. // In case of an exception, serve the non-minified version.
res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/default-mobile' : 'views/default'), { viewmode: viewmode, currentNode: currentNode, logoutControl: logoutcontrol, title: domain.title, title2: domain.title2, domainurl: domain.url, domain: domain.id, debuglevel: parent.debugLevel, serverDnsName: getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, noServerBackup: (args.noserverbackup == 1 ? 1 : 0), features: features, mpspass: args.mpspass, webcerthash: obj.webCertificateHashBase64, footer: (domain.footer == null) ? '' : domain.footer }); res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/default-mobile' : 'views/default'), { viewmode: viewmode, currentNode: currentNode, logoutControl: logoutcontrol, title: domain.title, title2: domain.title2, domainurl: domain.url, domain: domain.id, debuglevel: parent.debugLevel, serverDnsName: getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, noServerBackup: (args.noserverbackup == 1 ? 1 : 0), features: features, sessiontime: args.sessiontime, mpspass: args.mpspass, webcerthash: obj.webCertificateHashBase64, footer: (domain.footer == null) ? '' : domain.footer });
} }
} else { } else {
// Serve non-minified version of web pages. // Serve non-minified version of web pages.
res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/default-mobile' : 'views/default'), { viewmode: viewmode, currentNode: currentNode, logoutControl: logoutcontrol, title: domain.title, title2: domain.title2, domainurl: domain.url, domain: domain.id, debuglevel: parent.debugLevel, serverDnsName: getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, noServerBackup: (args.noserverbackup == 1 ? 1 : 0), features: features, mpspass: args.mpspass, webcerthash: obj.webCertificateHashBase64, footer: (domain.footer == null) ? '' : domain.footer }); res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/default-mobile' : 'views/default'), { viewmode: viewmode, currentNode: currentNode, logoutControl: logoutcontrol, title: domain.title, title2: domain.title2, domainurl: domain.url, domain: domain.id, debuglevel: parent.debugLevel, serverDnsName: getWebServerName(domain), serverRedirPort: args.redirport, serverPublicPort: httpsPort, noServerBackup: (args.noserverbackup == 1 ? 1 : 0), features: features, sessiontime: args.sessiontime, mpspass: args.mpspass, webcerthash: obj.webCertificateHashBase64, footer: (domain.footer == null) ? '' : domain.footer });
} }
} else { } else {
// Send back the login application // Send back the login application
@ -741,17 +741,17 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if ((parent.config != null) && (parent.config.settings != null) && (parent.config.settings.allowframing == true)) { features += 32; } // Allow site within iframe if ((parent.config != null) && (parent.config.settings != null) && (parent.config.settings.allowframing == true)) { features += 32; } // Allow site within iframe
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
if (obj.args.minify) { if (obj.args.minify && !req.query.nominify) {
// Try to server the minified version if we can. // Try to server the minified version if we can.
try { try {
res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile-min' : 'views/login-min'), { loginmode: loginmode, rootCertLink: getRootCertLink(), title: domain.title, title2: domain.title2, newAccount: domain.newaccounts, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: getWebServerName(domain), serverPublicPort: httpsPort, emailcheck: obj.parent.mailserver != null, features: features, footer: (domain.footer == null) ? '' : domain.footer }); res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile-min' : 'views/login-min'), { loginmode: loginmode, rootCertLink: getRootCertLink(), title: domain.title, title2: domain.title2, newAccount: domain.newaccounts, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: getWebServerName(domain), serverPublicPort: httpsPort, emailcheck: obj.parent.mailserver != null, features: features, sessiontime: args.sessiontime, footer: (domain.footer == null) ? '' : domain.footer });
} catch (ex) { } catch (ex) {
// In case of an exception, serve the non-minified version. // In case of an exception, serve the non-minified version.
res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile' : 'views/login'), { loginmode: loginmode, rootCertLink: getRootCertLink(), title: domain.title, title2: domain.title2, newAccount: domain.newaccounts, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: getWebServerName(domain), serverPublicPort: httpsPort, emailcheck: obj.parent.mailserver != null, features: features, footer: (domain.footer == null) ? '' : domain.footer }); res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile' : 'views/login'), { loginmode: loginmode, rootCertLink: getRootCertLink(), title: domain.title, title2: domain.title2, newAccount: domain.newaccounts, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: getWebServerName(domain), serverPublicPort: httpsPort, emailcheck: obj.parent.mailserver != null, features: features, sessiontime: args.sessiontime, footer: (domain.footer == null) ? '' : domain.footer });
} }
} else { } else {
// Serve non-minified version of web pages. // Serve non-minified version of web pages.
res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile' : 'views/login'), { loginmode: loginmode, rootCertLink: getRootCertLink(), title: domain.title, title2: domain.title2, newAccount: domain.newaccounts, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: getWebServerName(domain), serverPublicPort: httpsPort, emailcheck: obj.parent.mailserver != null, features: features, footer: (domain.footer == null) ? '' : domain.footer }); res.render(obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile' : 'views/login'), { loginmode: loginmode, rootCertLink: getRootCertLink(), title: domain.title, title2: domain.title2, newAccount: domain.newaccounts, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: getWebServerName(domain), serverPublicPort: httpsPort, emailcheck: obj.parent.mailserver != null, features: features, sessiontime: args.sessiontime, footer: (domain.footer == null) ? '' : domain.footer });
} }
/* /*