mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-29 22:16:11 +02:00
Add theme information to oputil user info
* Add theme ID * Allow lookup by user ID
This commit is contained in:
parent
51c9c7dc2d
commit
792acb0550
1 changed files with 9 additions and 0 deletions
|
@ -30,6 +30,10 @@ function initAndGetUser(userName, cb) {
|
||||||
const User = require('../../core/user.js');
|
const User = require('../../core/user.js');
|
||||||
User.getUserIdAndName(userName, (err, userId) => {
|
User.getUserIdAndName(userName, (err, userId) => {
|
||||||
if(err) {
|
if(err) {
|
||||||
|
// try user ID if number was supplied
|
||||||
|
if (_.isNumber(userName)) {
|
||||||
|
return User.getUser(parseInt(userName), callback);
|
||||||
|
}
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
return User.getUser(userId, callback);
|
return User.getUser(userId, callback);
|
||||||
|
@ -329,12 +333,17 @@ function showUserInfo(user) {
|
||||||
return user.properties[p] || 'N/A';
|
return user.properties[p] || 'N/A';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const currentTheme = () => {
|
||||||
|
return user.properties[UserProps.ThemeId];
|
||||||
|
};
|
||||||
|
|
||||||
const stdInfo = `User information:
|
const stdInfo = `User information:
|
||||||
Username : ${user.username}${user.isRoot() ? ' (root/SysOp)' : ''}
|
Username : ${user.username}${user.isRoot() ? ' (root/SysOp)' : ''}
|
||||||
Real name : ${propOrNA(UserProps.RealName)}
|
Real name : ${propOrNA(UserProps.RealName)}
|
||||||
ID : ${user.userId}
|
ID : ${user.userId}
|
||||||
Status : ${statusDesc()}
|
Status : ${statusDesc()}
|
||||||
Groups : ${user.groups.join(', ')}
|
Groups : ${user.groups.join(', ')}
|
||||||
|
Theme ID : ${currentTheme()}
|
||||||
Created : ${created()}
|
Created : ${created()}
|
||||||
Last login : ${lastLogin()}
|
Last login : ${lastLogin()}
|
||||||
Login count : ${propOrNA(UserProps.LoginCount)}
|
Login count : ${propOrNA(UserProps.LoginCount)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue