Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2017-03-02 18:51:06 -07:00
commit 94e04f1c69
2 changed files with 22 additions and 14 deletions

View File

@ -489,8 +489,8 @@ module.exports = class User {
return cb(err); return cb(err);
} }
properties[row.prop_name] = row.prop_value; properties[row.prop_name] = row.prop_value;
}, () => { }, (err) => {
return cb(null, properties); return cb(err, err ? null : properties);
}); });
} }

View File

@ -105,21 +105,29 @@ exports.getModule = class LastCallersModule extends MenuModule {
item.ts = moment(item.timestamp).format(dateTimeFormat); item.ts = moment(item.timestamp).format(dateTimeFormat);
User.getUserName(item.userId, (err, userName) => { User.getUserName(item.userId, (err, userName) => {
if(err) {
item.deleted = true;
return next(null);
} else {
item.userName = userName || 'N/A'; item.userName = userName || 'N/A';
User.loadProperties(item.userId, getPropOpts, (err, props) => { User.loadProperties(item.userId, getPropOpts, (err, props) => {
if(!err) { if(!err && props) {
item.location = props.location; item.location = props.location || 'N/A';
item.affiliation = item.affils = props.affiliation; item.affiliation = item.affils = (props.affiliation || 'N/A');
} else { } else {
item.location = 'N/A'; item.location = 'N/A';
item.affiliation = item.affils = 'N/A'; item.affiliation = item.affils = 'N/A';
} }
return next(); return next(null);
}); });
}
}); });
}, },
callback err => {
loginHistory = loginHistory.filter(lh => true !== lh.deleted);
return callback(err);
}
); );
}, },
function populateList(callback) { function populateList(callback) {