enigma-bbs/core/wfc.js

68 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-07-14 03:08:25 +00:00
// ENiGMA½
const { MenuModule } = require('./menu_module');
2020-09-25 21:41:21 +00:00
// deps
const async = require('async');
const _ = require('lodash');
2020-07-14 03:08:25 +00:00
exports.moduleInfo = {
name : 'WFC',
desc : 'Semi-Traditional Waiting For Caller',
author : 'NuSkooler',
};
2020-09-25 21:41:21 +00:00
const FormIds = {
main : 0,
};
const MciViewIds = {
main : {
nodeStatus : 0,
quickLogView : 1,
customRangeStart : 10,
}
};
// Secure + 2FA + root user + 'wfc' group.
const DefaultACS = 'SCAF2ID1GM[wfc]';
2020-07-14 03:08:25 +00:00
exports.getModule = class WaitingForCallerModule extends MenuModule {
constructor(options) {
super(options);
this.config = Object.assign({}, _.get(options, 'menuConfig.config'), { extraArgs : options.extraArgs });
2020-09-25 21:41:21 +00:00
this.config.acs = this.config.acs || DefaultACS;
if (!this.config.acs.includes('SC')) {
this.config.acs = 'SC' + this.config.acs; // secure connection at the very, very least
}
}
mciReady(mciData, cb) {
super.mciReady(mciData, err => {
if (err) {
return cb(err);
}
async.series(
[
(callback) => {
return this.prepViewController('main', FormIds.main, mciData.menu, callback);
},
(callback) => {
// const requiredCodes = [
// ];
// return this.validateMCIByViewIds('main', requiredCodes, callback);
return callback(null);
},
],
err => {
return cb(err);
}
);
});
2020-07-14 03:08:25 +00:00
}
};