* 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.serverType = moduleInst.getServerType();
client.session.serverName = module.moduleInfo.name;
client.session.isSecure = module.moduleInfo.isSecure || false;
clientConns.addNewClient(client, clientSock);

View File

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

View File

@ -54,7 +54,7 @@ function getPredefinedMCIValue(client, code) {
UC : function loginCount() { return client.user.properties.login_count.toString(); },
ND : function connectedNode() { return client.node.toString(); },
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()); },
CS : function currentStatus() { return client.currentStatus; },

View File

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

View File

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

View File

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