mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
Major changes around events, event log, etc.
* User event log is now functional & attached to various events * Add additional missing system events * Completely re-write last_callers to have new functionality, etc. * Events.addListenerMultipleEvents() * New 'moduleInitialize' export for module init vs Event specific registerEvents * Add docs on last_callers mod
This commit is contained in:
parent
c1ae3d88ba
commit
52585c78f0
16 changed files with 392 additions and 171 deletions
11
core/user.js
11
core/user.js
|
@ -179,7 +179,7 @@ module.exports = class User {
|
|||
);
|
||||
}
|
||||
|
||||
create(password, cb) {
|
||||
create(createUserInfo , cb) {
|
||||
assert(0 === this.userId);
|
||||
const config = Config();
|
||||
|
||||
|
@ -219,7 +219,7 @@ module.exports = class User {
|
|||
);
|
||||
},
|
||||
function genAuthCredentials(trans, callback) {
|
||||
User.generatePasswordDerivedKeyAndSalt(password, (err, info) => {
|
||||
User.generatePasswordDerivedKeyAndSalt(createUserInfo.password, (err, info) => {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
@ -244,7 +244,12 @@ module.exports = class User {
|
|||
});
|
||||
},
|
||||
function sendEvent(trans, callback) {
|
||||
Events.emit(Events.getSystemEvents().NewUser, { user : self });
|
||||
Events.emit(
|
||||
Events.getSystemEvents().NewUser,
|
||||
{
|
||||
user : Object.assign({}, self, { sessionId : createUserInfo.sessionId } )
|
||||
}
|
||||
);
|
||||
return callback(null, trans);
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue