forked from GitHub/dbot
		
	updates
This commit is contained in:
		
							parent
							
								
									c4828f7ef4
								
							
						
					
					
						commit
						cd92f0c4de
					
				| @ -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); | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
| @ -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 { | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Luke Slater
						Luke Slater