diff --git a/modules/atheme/atheme.js b/modules/atheme/atheme.js index 6bbbc96..9ab1502 100644 --- a/modules/atheme/atheme.js +++ b/modules/atheme/atheme.js @@ -129,14 +129,18 @@ var atheme = function(dbot) { }, this); } } else { // PRIVMSG +console.log(event.message); var akill = event.message.match(/([^ ]+) AKILL:ADD: ([^ ]+) \(reason: (.+)(\) )\(duration: ([^,)]+)/); if(event.channel == '#services' && akill) { - var channel = dbot.config.servers[server].admin_channel; - dbot.api.report.notify('ban', 'tripsit', akill[1], channel, dbot.t('akill', { - 'host': akill[2], - 'reason': akill[3], - 'duration': akill[4] - })); +console.log(akill); + var channel = dbot.config.servers[event.server].admin_channel; + dbot.api.users.getUser(akill[1] + '.' + event.server, function(err, user) { + dbot.api.report.notify('ban', 'tripsit', user, channel, dbot.t('akill', { + 'host': akill[2], + 'reason': akill[3], + 'duration': akill[5] + })); + }); } } }.bind(this); diff --git a/modules/users/users.js b/modules/users/users.js index 214603f..f0e6bb2 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -35,7 +35,7 @@ var users = function(dbot) { 'user': user.id }, function(err, result) { if(!err) { - dbot.api.event.emit('new_user_alias', [ user, alias ]); + dbot.api.event.emit('new_user_alias', [ result, alias ]); callback(null, result); } else { callback(true, null); diff --git a/modules/web/api.js b/modules/web/api.js index 79680ed..a168f44 100644 --- a/modules/web/api.js +++ b/modules/web/api.js @@ -28,6 +28,7 @@ var api = function(dbot) { accessNeeded, allowedNicks; +console.log('haxess called'); if(mConfig.requireWebLogin == true) { if(req.isAuthenticated()) { if(_.has(mConfig, 'pageAccess') && _.has(mConfig.pageAccess, path)) { @@ -56,7 +57,8 @@ var api = function(dbot) { } else { res.render('login', { 'message': 'You need to log in to access this module.', - 'redirect': req.originalUrl + 'redirect': req.originalUrl, + 'routes': dbot.modules.web.indexLinks }); } } else { diff --git a/modules/web/web.js b/modules/web/web.js index 46367e6..597f115 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -78,6 +78,7 @@ var webInterface = function(dbot) { var func = pages[p], mod = func.module; +console.log('adding ' + p); this.app.get(p, this.api.hasAccess, (function(req, resp) { // Crazy shim to seperate module views. var shim = Object.create(resp); @@ -123,14 +124,15 @@ var webInterface = function(dbot) { this.app.get('/login', function(req, res) { res.render('login', { 'user': req.user, - 'message': req.flash('error') + 'message': req.flash('error'), + 'routes': this.indexLinks }); - }); + }.bind(this)); this.app.post('/login', passport.authenticate('local', { 'failureRedirect': '/login', 'failureFlash': true, - 'routes': dbot.modules.web.indexLinks + 'routes': this.indexLinks }), function(req, res) { if(req.body.redirect) { res.redirect(req.body.redirect);