Improved scalability and migration support from MeshCentral1
Ylian Saint-Hilaire committed
Jul 16, 2018 at 17:49 UTC
bff85f428ad01af5d738a606ac25610f6724376b
8 files changed
+123
-20
amtscanner.js
+1
-1
@@ -112,7 +112,7 @@ module.exports.CreateAmtScanner = function (parent) {
112
obj.performScan = function () {
113
//console.log('performScan');
114
if (obj.action == false) { return false; }
115
- obj.parent.db.getLocalAmtNodes(function (err, docs) {
115
+ obj.parent.db.getLocalAmtNodes(10, function (err, docs) { // TODO: handler more than 10 computer scan at the same time.
116
for (var i in obj.scanTable) { obj.scanTable[i].present = false; }
117
if (err == null && docs.length > 0) {
118
for (var i in docs) {
db.js
+1
-1
@@ -109,7 +109,7 @@ module.exports.CreateDB = function (parent) {
109
obj.dispose = function () { for (var x in obj) { if (obj[x].close) { obj[x].close(); } delete obj[x]; } }
110
obj.clearOldEntries = function (type, days, domain) { var cutoff = Date.now() - (1000 * 60 * 60 * 24 * days); obj.file.remove({ type: type, time: { $lt: cutoff } }, { multi: true }); }
111
obj.getPowerTimeline = function (nodeid, func) { if (obj.databaseType == 1) { obj.file.find({ type: 'power', node: { $in: ['*', nodeid] } }).sort({ time: 1 }).exec(func); } else { obj.file.find({ type: 'power', node: { $in: ['*', nodeid] } }).sort({ time: 1 }, func); } }
112
- obj.getLocalAmtNodes = function (func) { obj.file.find({ type: 'node', host: { $exists: true, $ne: null }, intelamt: { $exists: true } }, func); }
112
+ obj.getLocalAmtNodes = function (limit, func) { obj.file.find({ type: 'node', host: { $exists: true, $ne: null }, intelamt: { $exists: true } }).limit(limit, func); }
113
obj.getAmtUuidNode = function (meshid, uuid, func) { obj.file.find({ type: 'node', meshid: meshid, 'intelamt.uuid': uuid }, func); }
114
115
// This is used to rate limit a number of operation per day. Returns a startValue each new days, but you can substract it and save the value in the db.
meshcentral.js
+43
-5
@@ -79,7 +79,7 @@ function CreateMeshCentralServer(config, args) {
79
try { require('./pass').hash('test', function () { }); } catch (e) { console.log('Old version of node, must upgrade.'); return; } // TODO: Not sure if this test works or not.
80
81
// Check for invalid arguments
82
- var validArguments = ['_', 'notls', 'user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'cert', 'mpscert', 'deletedomain', 'deletedefaultdomain', 'showall', 'showusers', 'shownodes', 'showmeshes', 'showevents', 'showpower', 'clearpower', 'showiplocations', 'help', 'exactports', 'install', 'uninstall', 'start', 'stop', 'restart', 'debug', 'filespath', 'datapath', 'noagentupdate', 'launch', 'noserverbackup', 'mongodb', 'mongodbcol', 'wanonly', 'lanonly', 'nousers', 'mpsdebug', 'mpspass', 'ciralocalfqdn', 'dbexport', 'dbimport', 'selfupdate', 'tlsoffload', 'userallowedip', 'fastcert', 'swarmport', 'swarmdebug', 'logintoken', 'logintokenkey', 'logintokengen', 'logintokengen', 'mailtokengen'];
82
+ var validArguments = ['_', 'notls', 'user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'cert', 'mpscert', 'deletedomain', 'deletedefaultdomain', 'showall', 'showusers', 'shownodes', 'showmeshes', 'showevents', 'showpower', 'clearpower', 'showiplocations', 'help', 'exactports', 'install', 'uninstall', 'start', 'stop', 'restart', 'debug', 'filespath', 'datapath', 'noagentupdate', 'launch', 'noserverbackup', 'mongodb', 'mongodbcol', 'wanonly', 'lanonly', 'nousers', 'mpsdebug', 'mpspass', 'ciralocalfqdn', 'dbexport', 'dbimport', 'selfupdate', 'tlsoffload', 'userallowedip', 'fastcert', 'swarmport', 'swarmdebug', 'logintoken', 'logintokenkey', 'logintokengen', 'logintokengen', 'mailtokengen', 'admin', 'unadmin'];
83
for (var arg in obj.args) { obj.args[arg.toLocaleLowerCase()] = obj.args[arg]; if (validArguments.indexOf(arg.toLocaleLowerCase()) == -1) { console.log('Invalid argument "' + arg + '", use --help.'); return; } }
84
if (obj.args.mongodb == true) { console.log('Must specify: --mongodb [connectionstring] \r\nSee https://docs.mongodb.com/manual/reference/connection-string/ for MongoDB connection string.'); return; }
85
for (var i in obj.config.settings) { obj.args[i] = obj.config.settings[i]; } // Place all settings into arguments, arguments have already been placed into settings so arguments take precedence.
@@ -199,7 +199,7 @@ function CreateMeshCentralServer(config, args) {
199
obj.StartEx = function () {
200
//var wincmd = require('node-windows');
201
//wincmd.list(function (svc) { console.log(svc); }, true);
202
-
202
+
203
// Write the server state
204
obj.updateServerState('state', 'starting');
205
@@ -265,12 +265,14 @@ function CreateMeshCentralServer(config, args) {
265
if (obj.args.dbimport) {
266
// Import the entire database from a JSON file
267
if (obj.args.dbimport == true) { obj.args.dbimport = obj.getConfigFilePath('meshcentral.db.json'); }
268
- var json = null, json2 = "";
269
- try { json = obj.fs.readFileSync(obj.args.dbimport); } catch (e) { console.log('Invalid JSON file: ' + obj.args.dbimport + '.'); process.exit(); }
270
- for (var i = 0; i < json.length; i++) { if (json[i] >= 32) json2 += String.fromCharCode(json[i]); } // Remove all bad chars
268
+ var json = null, json2 = "", badCharCount = 0;
269
+ try { json = obj.fs.readFileSync(obj.args.dbimport, { encoding: 'utf8' }); } catch (e) { console.log('Invalid JSON file: ' + obj.args.dbimport + '.'); process.exit(); }
270
+ for (var i = 0; i < json.length; i++) { if (json.charCodeAt(i) >= 32) { json2 += json[i]; } else { var tt = json.charCodeAt(i); if (tt != 10 && tt != 13) { badCharCount++; } } } // Remove all bad chars
271
+ if (badCharCount > 0) { console.log(badCharCount + ' invalid character(s) where removed.'); }
272
try { json = JSON.parse(json2); } catch (e) { console.log('Invalid JSON format: ' + obj.args.dbimport + ': ' + e); process.exit(); }
273
if ((json == null) || (typeof json.length != 'number') || (json.length < 1)) { console.log('Invalid JSON format: ' + obj.args.dbimport + '.'); }
274
for (var i in json) { if ((json[i].type == "mesh") && (json[i].links != null)) { for (var j in json[i].links) { var esc = obj.common.escapeFieldName(j); if (esc !== j) { json[i].links[esc] = json[i].links[j]; delete json[i].links[j]; } } } } // Escape MongoDB invalid field chars
275
+ //for (var i in json) { if ((json[i].type == "node") && (json[i].host != null)) { json[i].rname = json[i].host; delete json[i].host; } } // DEBUG: Change host to rname
276
obj.db.RemoveAll(function () { obj.db.InsertMany(json, function (err) { if (err != null) { console.log(err); } else { console.log('Imported ' + json.length + ' objects(s) from ' + obj.args.dbimport + '.'); } process.exit(); }); });
277
return;
278
}
@@ -279,6 +281,42 @@ function CreateMeshCentralServer(config, args) {
281
obj.db.clearOldEntries('event', 30); // Clear all event entires that are older than 30 days.
282
obj.db.clearOldEntries('power', 10); // Clear all event entires that are older than 10 days. If a node is connected longer than 10 days, current power state will be used for everything.
283
284
+ // Setup a site administrator
285
+ if ((obj.args.admin) && (typeof obj.args.admin == 'string')) {
286
+ var adminname = obj.args.admin.split('/');
287
+ if (adminname.length == 1) { adminname = 'user//' + adminname[0]; }
288
+ else if (adminname.length == 2) { adminname = 'user/' + adminname[0] + '/' + adminname[1]; }
289
+ else { console.log('Invalid administrator name.'); process.exit(); return; }
290
+ obj.db.Get(adminname, function (err, user) {
291
+ if (user.length != 1) { console.log('Invalid user name.'); process.exit(); return; }
292
+ user[0].siteadmin = 0xFFFFFFFF;
293
+ obj.db.Set(user[0], function () {
294
+ if (user[0].domain == '') { console.log('User ' + user[0].name + ' set to site administrator.'); } else { console.log('User ' + user[0].name + ' of domain ' + user[0].domain + ' set to site administrator.'); }
295
+ process.exit();
296
+ return;
297
+ });
298
+ });
299
+ return;
300
+ }
301
+
302
+ // Remove a site administrator
303
+ if ((obj.args.unadmin) && (typeof obj.args.unadmin == 'string')) {
304
+ var adminname = obj.args.unadmin.split('/');
305
+ if (adminname.length == 1) { adminname = 'user//' + adminname[0]; }
306
+ else if (adminname.length == 2) { adminname = 'user/' + adminname[0] + '/' + adminname[1]; }
307
+ else { console.log('Invalid administrator name.'); process.exit(); return; }
308
+ obj.db.Get(adminname, function (err, user) {
309
+ if (user.length != 1) { console.log('Invalid user name.'); process.exit(); return; }
310
+ if (user[0].siteadmin) { delete user[0].siteadmin; }
311
+ obj.db.Set(user[0], function () {
312
+ if (user[0].domain == '') { console.log('User ' + user[0].name + ' is not a site administrator.'); } else { console.log('User ' + user[0].name + ' of domain ' + user[0].domain + ' is not a site administrator.'); }
313
+ process.exit();
314
+ return;
315
+ });
316
+ });
317
+ return;
318
+ }
319
+
320
// Perform other database cleanup
321
obj.db.cleanup();
322
meshuser.js
+6
@@ -717,6 +717,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) {
717
if (command.amttls == '0') { command.amttls = 0; } else if (command.amttls == '1') { command.amttls = 1; } // Check TLS flag
718
if ((command.amttls != 1) && (command.amttls != 0)) break;
719
720
+ // If we are in WAN-only mode, hostname is not used
721
+ if ((obj.parent.parent.args.wanonly == true) && (command.hostname)) { delete command.hostname; }
722
+
723
// Get the mesh
724
var mesh = obj.parent.meshes[command.meshid];
725
if (mesh) {
@@ -972,6 +975,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain) {
975
var changes = [], change = 0, event = { etype: 'node', username: user.name, action: 'changenode', nodeid: node._id, domain: domain.id };
976
event.msg = ": ";
977
978
+ // If we are in WAN-only mode, host is not used
979
+ if ((obj.parent.parent.args.wanonly == true) && (command.host)) { delete command.host; }
980
+
981
// Look for a change
982
if (command.icon && (command.icon != node.icon)) { change = 1; node.icon = command.icon; changes.push('icon'); }
983
if (command.name && (command.name != node.name)) { change = 1; node.name = command.name; changes.push('name'); }
public/styles/style.css
+7
-1
@@ -531,4 +531,10 @@ a {
531
532
.deskToolsBar:hover {
533
background-color: #EFE8B6;
534
-}
\ No newline at end of file
534
+}
535
+
536
+.userTableHeader {
537
+ border-bottom: 1pt solid lightgray;
538
+ padding-top: 4px;
539
+ padding-bottom: 4px;
540
+}
sample-config.json
+2
-1
@@ -8,7 +8,8 @@
8
"AllowLoginToken": true,
9
"AllowFraming": true,
10
"WebRTC": false,
11
- "ClickOnce": false
11
+ "ClickOnce": false,
12
+ "UserAllowedIP" : "127.0.0.1,::1,192.168.0.100"
13
},
14
"_domains": {
15
"": {
views/default.handlebars
+51
-11
@@ -246,7 +246,10 @@
246
<div style=width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px>
247
<div class=style7 style=width:16px;height:100%;float:left> </div>
248
<div class=h1 style=height:100%;float:left> </div>
249
- <div class=style14 style=height:100%;float:left> <input type=button onclick=showCreateNewAccountDialog() value="New Account..." /> </div>
249
+ <div class=style14 style=height:100%;float:left>
250
+ <input type=button onclick=showCreateNewAccountDialog() value="New Account..." />
251
+ <input id=UserSearchInput type=text style=width:120px placeholder=Search onchange=onUserSearchInputChanged() onkeyup=onUserSearchInputChanged() autocomplete=off onfocus=onUserSearchFocus(1) onblur=onUserSearchFocus(0) />
252
+ </div>
253
<div class=auto-style1 style="height:100%;float:right">
254
<div style="height:100%;width:20px;float:right;background-color:#ffffff"></div>
255
<div class=h2 style="height:100%;float:right"> </div>
@@ -748,6 +751,7 @@
751
var sort = 0;
752
var searchFocus = 0;
753
var mapSearchFocus = 0;
754
+ var userSearchFocus = 0;
755
var consoleFocus = 0;
756
var showRealNames = false;
757
var meshserver = null;
@@ -1412,6 +1416,18 @@
1416
if (!xxdialogMode && xxcurrentView == 11 && desktop && Q("DeskControl").checked) return desktop.m.handleKeys(e);
1417
if (!xxdialogMode && xxcurrentView == 12 && terminal && terminal.State == 3) return terminal.m.TermHandleKeys(e);
1418
if (!xxdialogMode && xxcurrentView == 15) return agentConsoleHandleKeys(e);
1419
+ if (!xxdialogMode && xxcurrentView == 4) {
1420
+ if (e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
1421
+ var processed = 0;
1422
+ if (e.key) {
1423
+ if (e.key.length === 1 && userSearchFocus == 0) { Q('UserSearchInput').value = ((Q('UserSearchInput').value + e.key)); processed = 1; }
1424
+ if (e.keyCode == 8 && userSearchFocus == 0) { var x = Q('UserSearchInput').value; Q('UserSearchInput').value = x.substring(0, x.length - 1); processed = 1; }
1425
+ if (e.keyCode == 27) { Q('UserSearchInput').value = ''; processed = 1; }
1426
+ } else {
1427
+ if (e.charCode != 0 && userSearchFocus == 0) { Q('UserSearchInput').value = ((Q('UserSearchInput').value + String.fromCharCode(e.charCode))); processed = 1; }
1428
+ }
1429
+ if (processed > 0) { if (processed == 1) { onUserSearchInputChanged(); } return haltEvent(e); }
1430
+ }
1431
if (xxdialogMode || xxcurrentView != 1) return;
1432
if (e.ctrlKey == true && e.charCode == 96) {
1433
showRealNames = !showRealNames;
@@ -1449,6 +1465,11 @@
1465
if (!xxdialogMode && xxcurrentView == 12 && terminal && terminal.State == 3) { return terminal.m.TermHandleKeyDown(e); }
1466
if (!xxdialogMode && xxcurrentView == 13 && e.keyCode == 116 && p13filetree != null) { haltEvent(e); return false; } // F5 Refresh on files
1467
if (!xxdialogMode && xxcurrentView == 15) { return agentConsoleHandleKeys(e); }
1468
+ if (!xxdialogMode && xxcurrentView == 4) {
1469
+ if (e.keyCode === 8 && userSearchFocus == 0) { var x = Q('UserSearchInput').value; Q('UserSearchInput').value = (x.substring(0, x.length - 1)); processed = 1; }
1470
+ if (e.keyCode === 27) { Q('UserSearchInput').value = ''; processed = 1; }
1471
+ if (processed > 0) { if (processed == 1) { onSearchInputChanged(); } return haltEvent(e); }
1472
+ }
1473
if (xxdialogMode || xxcurrentView != 1 || e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
1474
var processed = 0;
1475
if (Q('viewselect').value < 3) {
@@ -1466,6 +1487,7 @@
1487
if (!xxdialogMode && xxcurrentView == 11 && desktop && Q("DeskControl").checked) return desktop.m.handleKeyUp(e);
1488
if (!xxdialogMode && xxcurrentView == 12 && terminal && terminal.State == 3) return terminal.m.TermHandleKeyUp(e);
1489
if (!xxdialogMode && xxcurrentView == 13 && e.keyCode == 116 && p13filetree != null) { p13folderup(9999); haltEvent(e); return false; } // F5 Refresh on files
1490
+ if (!xxdialogMode && xxcurrentView == 4) { if ((e.keyCode === 8 && searchFocus == 0) || e.keyCode === 27) { return haltEvent(e); } }
1491
if (xxdialogMode && e.keyCode == 27) { dialogclose(0); }
1492
if (xxdialogMode || xxcurrentView != 0 || e.ctrlKey == true || e.altKey == true || e.metaKey == true) return;
1493
if (Q('viewselect').value < 3) { if ((e.keyCode === 8 && searchFocus == 0) || e.keyCode === 27) { return haltEvent(e); } }
@@ -2110,6 +2132,7 @@
2132
function deviceHostSort(a, b) { if (a.rnamel > b.rnamel) return 1; if (a.rnamel < b.rnamel) return -1; return 0; }
2133
function onSearchFocus(x) { searchFocus = x; }
2134
function onMapSearchFocus(x) { mapSearchFocus = x; }
2135
+ function onUserSearchFocus(x) { userSearchFocus = x; }
2136
function onConsoleFocus(x) { consoleFocus = x; }
2137
2138
function onSearchInputChanged() {
@@ -2838,10 +2861,10 @@
2861
x += addDeviceAttribute('<span title="The name of the administrative group this computer belong to">Mesh</span>', '<a title="The name of the group this computer belong to" onclick=gotoMesh("' + node.meshid + '") style=cursor:pointer>' + EscapeHtml(meshes[node.meshid].name) + '</a>');
2862
2863
// Attribute: Name
2841
- if (node.rname != null) { x += addDeviceAttribute('<span title="The name of this computer as set in the operating system">Name</span>', '<span title="The name of this computer as set in the operating system">' + EscapeHtml(node.rname) + '</span>'); }
2864
+ if ((node.rname != null) && (node.name != node.rname)) { x += addDeviceAttribute('<span title="The name of this computer as set in the operating system">Name</span>', '<span title="The name of this computer as set in the operating system">' + EscapeHtml(node.rname) + '</span>'); }
2865
2866
// Attribute: Host
2844
- if ((mesh.mtype == 1) || (node.name != node.host)) {
2867
+ if ((features & 1) == 0) { // If not WAN-only, local hostname is in use
2868
if ((meshrights & 4) != 0) {
2869
if (node.host) {
2870
x += addDeviceAttribute('Hostname', '<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>' + EscapeHtml(node.host) + '</span>');
@@ -5126,19 +5149,27 @@
5149
if ((users == null) || ((features & 4) != 0)) { QH('p3users', ''); return; }
5150
5151
// Sort the list of user id's
5129
- var sortedUserIds = [];
5152
+ var sortedUserIds = [], maxUsers = 100, hiddenUsers = 0;
5153
for (var i in users) { sortedUserIds.push(i); }
5154
sortedUserIds.sort();
5155
5156
+ // Get search
5157
+ var userSearch = Q('UserSearchInput').value.toLowerCase();
5158
+
5159
// Display the users using the sorted list
5160
var x = '<table style=width:100% cellpadding=0 cellspacing=0>', addHeader = true;
5161
// Online users
5162
for (var i in sortedUserIds) {
5163
var user = users[sortedUserIds[i]], sessions = null;
5164
if (wssessions != null) { sessions = wssessions[user._id]; }
5139
- if (sessions != null) {
5140
- if (addHeader) { x += '<tr><td style="border-bottom:1pt solid lightgray;padding-top:4px;padding-bottom:4px">Online Users</td></tr>'; addHeader = false; }
5141
- x += addUserHtml(user, sessions);
5165
+ if ((sessions != null) && (user.name.toLowerCase().indexOf(userSearch) >= 0)) {
5166
+ if (maxUsers > 0) {
5167
+ if (addHeader) { x += '<tr><td class=userTableHeader>Online Users'; addHeader = false; }
5168
+ x += addUserHtml(user, sessions);
5169
+ maxUsers--;
5170
+ } else {
5171
+ hiddenUsers++;
5172
+ }
5173
}
5174
}
5175
addHeader = true;
@@ -5146,12 +5177,19 @@
5177
for (var i in sortedUserIds) {
5178
var user = users[sortedUserIds[i]], sessions = null;
5179
if (wssessions != null) { sessions = wssessions[user._id]; }
5149
- if (sessions == null) {
5150
- if (addHeader) { x += '<tr><td style="border-bottom:1pt solid lightgray;padding-top:4px;padding-bottom:4px">Offline Users</td></tr>'; addHeader = false; }
5151
- x += addUserHtml(user, sessions);
5180
+ if ((sessions == null) && (user.name.toLowerCase().indexOf(userSearch) >= 0)) {
5181
+ if (maxUsers > 0) {
5182
+ if (addHeader) { x += '<tr><td class=userTableHeader>Offline Users'; addHeader = false; }
5183
+ x += addUserHtml(user, sessions);
5184
+ maxUsers--;
5185
+ } else {
5186
+ hiddenUsers++;
5187
+ }
5188
}
5189
}
5190
x += '</table>';
5191
+ if (hiddenUsers == 1) { x += '<br />1 more user not shown, use search box to look for users...<br />'; }
5192
+ else if (hiddenUsers > 1) { x += '<br />' + hiddenUsers + ' more users not shown, use search box to look for users...<br />'; }
5193
QH('p3users', x);
5194
5195
// Update current user panel if needed
@@ -5191,7 +5229,7 @@
5229
x += '<div class=bar style=height:24px;width:100%;font-size:medium>';
5230
x += '<div style=float:left;height:24px;width:24px;background-color:white><div class="' + icon + gray + '" style=width:16px;margin-top:4px;margin-left:2px;height:16px></div></div>';
5231
x += '<div class=g1 style=height:24px;float:left></div><div class=g2 style=height:24px;float:right></div>';
5194
- x += '<div><span>' + username + '</span><span style=float:right>' + msg + '</span></div></div></td></tr>';
5232
+ x += '<div><span>' + username + '</span><span style=float:right>' + msg + '</span></div></div>'; // </td></tr>
5233
return x;
5234
}
5235
@@ -5294,6 +5332,8 @@
5332
meshserver.send(x);
5333
}
5334
5335
+ function onUserSearchInputChanged() { updateUsers(); }
5336
+
5337
//
5338
// MY USERS GENERAL
5339
//
webserver.js
+12
@@ -316,6 +316,8 @@ module.exports.CreateWebServer = function (parent, db, args, secret, certificate
316
if (req.session.passhint) { delete req.session.passhint; }
317
if (req.body.viewmode) { req.session.viewmode = req.body.viewmode; }
318
if (req.body.host) {
319
+ // TODO: This is a terrible search!!! FIX THIS.
320
+ /*
321
obj.db.GetAllType('node', function (err, docs) {
322
for (var i = 0; i < docs.length; i++) {
323
if (docs[i].name == req.body.host) {
@@ -327,6 +329,7 @@ module.exports.CreateWebServer = function (parent, db, args, secret, certificate
329
// This redirect happens after finding node is completed
330
res.redirect(domain.url);
331
});
332
+ */
333
} else {
334
res.redirect(domain.url);
335
}
@@ -722,6 +725,15 @@ module.exports.CreateWebServer = function (parent, db, args, secret, certificate
725
if ((parent.config != null) && (parent.config.settings != null) && (parent.config.settings.allowframing == true)) { features += 32; } // Allow site within iframe
726
var httpsPort = ((obj.args.aliasport == null) ? obj.args.port : obj.args.aliasport); // Use HTTPS alias port is specified
727
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 });
728
+
729
+ /*
730
+ var xoptions = { 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 };
731
+ var xpath = obj.path.join(__dirname, isMobileBrowser(req) ? 'views/login-mobile' : 'views/login');
732
+ console.log('Render...');
733
+ res.render(xpath, xoptions, function (err, html) {
734
+ console.log(err, html);
735
+ });
736
+ */
737
}
738
}
739