forked from GitHub/dbot
updates
This commit is contained in:
parent
c4828f7ef4
commit
cd92f0c4de
@ -129,14 +129,18 @@ var atheme = function(dbot) {
|
|||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
} else { // PRIVMSG
|
} else { // PRIVMSG
|
||||||
|
console.log(event.message);
|
||||||
var akill = event.message.match(/([^ ]+) AKILL:ADD: ([^ ]+) \(reason: (.+)(\) )\(duration: ([^,)]+)/);
|
var akill = event.message.match(/([^ ]+) AKILL:ADD: ([^ ]+) \(reason: (.+)(\) )\(duration: ([^,)]+)/);
|
||||||
if(event.channel == '#services' && akill) {
|
if(event.channel == '#services' && akill) {
|
||||||
var channel = dbot.config.servers[server].admin_channel;
|
console.log(akill);
|
||||||
dbot.api.report.notify('ban', 'tripsit', akill[1], channel, dbot.t('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],
|
'host': akill[2],
|
||||||
'reason': akill[3],
|
'reason': akill[3],
|
||||||
'duration': akill[4]
|
'duration': akill[5]
|
||||||
}));
|
}));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
@ -35,7 +35,7 @@ var users = function(dbot) {
|
|||||||
'user': user.id
|
'user': user.id
|
||||||
}, function(err, result) {
|
}, function(err, result) {
|
||||||
if(!err) {
|
if(!err) {
|
||||||
dbot.api.event.emit('new_user_alias', [ user, alias ]);
|
dbot.api.event.emit('new_user_alias', [ result, alias ]);
|
||||||
callback(null, result);
|
callback(null, result);
|
||||||
} else {
|
} else {
|
||||||
callback(true, null);
|
callback(true, null);
|
||||||
|
@ -28,6 +28,7 @@ var api = function(dbot) {
|
|||||||
accessNeeded,
|
accessNeeded,
|
||||||
allowedNicks;
|
allowedNicks;
|
||||||
|
|
||||||
|
console.log('haxess called');
|
||||||
if(mConfig.requireWebLogin == true) {
|
if(mConfig.requireWebLogin == true) {
|
||||||
if(req.isAuthenticated()) {
|
if(req.isAuthenticated()) {
|
||||||
if(_.has(mConfig, 'pageAccess') && _.has(mConfig.pageAccess, path)) {
|
if(_.has(mConfig, 'pageAccess') && _.has(mConfig.pageAccess, path)) {
|
||||||
@ -56,7 +57,8 @@ var api = function(dbot) {
|
|||||||
} else {
|
} else {
|
||||||
res.render('login', {
|
res.render('login', {
|
||||||
'message': 'You need to log in to access this module.',
|
'message': 'You need to log in to access this module.',
|
||||||
'redirect': req.originalUrl
|
'redirect': req.originalUrl,
|
||||||
|
'routes': dbot.modules.web.indexLinks
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,6 +78,7 @@ var webInterface = function(dbot) {
|
|||||||
var func = pages[p],
|
var func = pages[p],
|
||||||
mod = func.module;
|
mod = func.module;
|
||||||
|
|
||||||
|
console.log('adding ' + p);
|
||||||
this.app.get(p, this.api.hasAccess, (function(req, resp) {
|
this.app.get(p, this.api.hasAccess, (function(req, resp) {
|
||||||
// Crazy shim to seperate module views.
|
// Crazy shim to seperate module views.
|
||||||
var shim = Object.create(resp);
|
var shim = Object.create(resp);
|
||||||
@ -123,14 +124,15 @@ var webInterface = function(dbot) {
|
|||||||
this.app.get('/login', function(req, res) {
|
this.app.get('/login', function(req, res) {
|
||||||
res.render('login', {
|
res.render('login', {
|
||||||
'user': req.user,
|
'user': req.user,
|
||||||
'message': req.flash('error')
|
'message': req.flash('error'),
|
||||||
});
|
'routes': this.indexLinks
|
||||||
});
|
});
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
this.app.post('/login', passport.authenticate('local', {
|
this.app.post('/login', passport.authenticate('local', {
|
||||||
'failureRedirect': '/login',
|
'failureRedirect': '/login',
|
||||||
'failureFlash': true,
|
'failureFlash': true,
|
||||||
'routes': dbot.modules.web.indexLinks
|
'routes': this.indexLinks
|
||||||
}), function(req, res) {
|
}), function(req, res) {
|
||||||
if(req.body.redirect) {
|
if(req.body.redirect) {
|
||||||
res.redirect(req.body.redirect);
|
res.redirect(req.body.redirect);
|
||||||
|
Loading…
Reference in New Issue
Block a user