mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
Code cleanup & resolve some minor TODO's in dropfile gen
This commit is contained in:
parent
a8604ece54
commit
8652b35b46
3 changed files with 30 additions and 22 deletions
16
core/user.js
16
core/user.js
|
@ -15,11 +15,12 @@ const Log = require('./logger.js').log;
|
|||
const StatLog = require('./stat_log.js');
|
||||
|
||||
// deps
|
||||
const crypto = require('crypto');
|
||||
const assert = require('assert');
|
||||
const async = require('async');
|
||||
const _ = require('lodash');
|
||||
const moment = require('moment');
|
||||
const crypto = require('crypto');
|
||||
const assert = require('assert');
|
||||
const async = require('async');
|
||||
const _ = require('lodash');
|
||||
const moment = require('moment');
|
||||
const sanatizeFilename = require('sanitize-filename');
|
||||
|
||||
exports.isRootUserId = function(id) { return 1 === id; };
|
||||
|
||||
|
@ -114,6 +115,11 @@ module.exports = class User {
|
|||
return isMember;
|
||||
}
|
||||
|
||||
getSanitizedName(type='username') {
|
||||
const name = 'real' === type ? this.getProperty(UserProps.RealName) : this.username;
|
||||
return sanatizeFilename(name) || `user${this.userId.toString()}`;
|
||||
}
|
||||
|
||||
getLegacySecurityLevel() {
|
||||
if(this.isRoot() || this.isGroupMember('sysops')) {
|
||||
return 100;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue