* Better place to get server name/type

* Servers export 'isSecure'
This commit is contained in:
Bryan Ashby 2015-10-22 00:03:18 -06:00
parent ad4eea6ba7
commit 12e7722ec9
6 changed files with 13 additions and 20 deletions

View File

@ -193,7 +193,8 @@ function startListening() {
client.session = {}; client.session = {};
} }
client.session.serverType = moduleInst.getServerType(); client.session.serverName = module.moduleInfo.name;
client.session.isSecure = module.moduleInfo.isSecure || false;
clientConns.addNewClient(client, clientSock); clientConns.addNewClient(client, clientSock);

View File

@ -22,7 +22,8 @@ function addNewClient(client, clientSock) {
var connInfo = { var connInfo = {
ip : clientSock.remoteAddress, ip : clientSock.remoteAddress,
serverType : client.session.serverType, serverName : client.session.serverName,
isSecure : client.session.isSecure,
}; };
if(client.log.debug()) { if(client.log.debug()) {

View File

@ -54,7 +54,7 @@ function getPredefinedMCIValue(client, code) {
UC : function loginCount() { return client.user.properties.login_count.toString(); }, UC : function loginCount() { return client.user.properties.login_count.toString(); },
ND : function connectedNode() { return client.node.toString(); }, ND : function connectedNode() { return client.node.toString(); },
IP : function clientIpAddress() { return client.address().address; }, IP : function clientIpAddress() { return client.address().address; },
ST : function serverType() { return client.session.serverType; }, ST : function serverName() { return client.session.serverName; },
MS : function accountCreated() { return moment(client.user.properties.account_created).format(client.currentTheme.helpers.getDateFormat()); }, MS : function accountCreated() { return moment(client.user.properties.account_created).format(client.currentTheme.helpers.getDateFormat()); },
CS : function currentStatus() { return client.currentStatus; }, CS : function currentStatus() { return client.currentStatus; },

View File

@ -13,6 +13,3 @@ require('util').inherits(ServerModule, PluginModule);
ServerModule.prototype.createServer = function() { ServerModule.prototype.createServer = function() {
}; };
ServerModule.prototype.getServerType = function() {
};

View File

@ -18,7 +18,8 @@ var assert = require('assert');
exports.moduleInfo = { exports.moduleInfo = {
name : 'SSH', name : 'SSH',
desc : 'SSH Server', desc : 'SSH Server',
author : 'NuSkooler' author : 'NuSkooler',
isSecure : true,
}; };
exports.getModule = SSHServerModule; exports.getModule = SSHServerModule;
@ -232,7 +233,3 @@ SSHServerModule.prototype.createServer = function() {
return server; return server;
}; };
SSHServerModule.prototype.getServerType = function() {
return 'SSH';
};

View File

@ -18,7 +18,8 @@ var util = require('util');
exports.moduleInfo = { exports.moduleInfo = {
name : 'Telnet', name : 'Telnet',
desc : 'Telnet Server', desc : 'Telnet Server',
author : 'NuSkooler' author : 'NuSkooler',
isSecure : false,
}; };
exports.getModule = TelnetServerModule; exports.getModule = TelnetServerModule;
@ -785,7 +786,3 @@ TelnetServerModule.prototype.createServer = function() {
return server; return server;
}; };
TelnetServerModule.prototype.getServerType = function() {
return 'TELNET';
};