diff --git a/WHATSNEW.md b/WHATSNEW.md index bce2ba32..bedc54e4 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -15,6 +15,8 @@ This document attempts to track **major** changes and additions in ENiGMA½. For * The old concept of `autoScale` has been removed. See https://github.com/NuSkooler/enigma-bbs/issues/166 * Ability to delete from personal mailbox (finally!) * Add ability to skip file and/or message areas during newscan. Set config.omitFileAreaTags and config.omitMessageAreaTags in new_scan configuration of your menu.hjson +* `{userName}` (sanatized) and `{userNameRaw}` as well as `{cwd}` have been added to param options when launching a door. + ## 0.0.8-alpha * [Mystic BBS style](http://wiki.mysticbbs.com/doku.php?id=displaycodes) extended pipe color codes. These allow for example, to set "iCE" background colors. diff --git a/core/door.js b/core/door.js index 5ad5855a..1ac0754f 100644 --- a/core/door.js +++ b/core/door.js @@ -1,13 +1,15 @@ /* jslint node: true */ 'use strict'; -const stringFormat = require('./string_format.js'); -const { Errors } = require('./enig_error.js'); +const stringFormat = require('./string_format.js'); +const { Errors } = require('./enig_error.js'); -const pty = require('node-pty'); -const decode = require('iconv-lite').decode; -const createServer = require('net').createServer; -const paths = require('path'); +// deps +const pty = require('node-pty'); +const decode = require('iconv-lite').decode; +const createServer = require('net').createServer; +const paths = require('path'); +const sanatizeFilename = require('sanitize-filename'); module.exports = class Door { constructor(client) { @@ -64,6 +66,8 @@ module.exports = class Door { node : exeInfo.node.toString(), srvPort : this.sockServer ? this.sockServer.address().port.toString() : '-1', userId : this.client.user.userId.toString(), + userName : sanatizeFilename(this.client.user.username), + userNameRaw : this.client.user.username, cwd : cwd, };