2017-02-18 01:56:23 -07:00
|
|
|
'use strict';
|
2016-03-15 12:13:35 +02:00
|
|
|
|
2017-05-10 16:27:44 -04:00
|
|
|
var async = require('async');
|
|
|
|
|
|
2016-03-15 12:13:35 +02:00
|
|
|
var user = require('../user');
|
|
|
|
|
var adminBlacklistController = require('./admin/blacklist');
|
2019-01-29 13:11:45 -05:00
|
|
|
var usersController = require('./admin/users');
|
2016-03-15 12:13:35 +02:00
|
|
|
|
2017-05-10 16:27:44 -04:00
|
|
|
var globalModsController = module.exports;
|
2016-03-15 12:13:35 +02:00
|
|
|
|
2016-10-13 11:43:39 +02:00
|
|
|
globalModsController.ipBlacklist = function (req, res, next) {
|
2017-05-10 16:27:44 -04:00
|
|
|
async.waterfall([
|
|
|
|
|
function (next) {
|
|
|
|
|
user.isAdminOrGlobalMod(req.uid, next);
|
|
|
|
|
},
|
|
|
|
|
function (isAdminOrGlobalMod, next) {
|
|
|
|
|
if (!isAdminOrGlobalMod) {
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
adminBlacklistController.get(req, res, next);
|
|
|
|
|
},
|
|
|
|
|
], next);
|
2016-03-15 12:13:35 +02:00
|
|
|
};
|
2019-01-29 13:11:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
globalModsController.registrationQueue = function (req, res, next) {
|
|
|
|
|
async.waterfall([
|
|
|
|
|
function (next) {
|
|
|
|
|
user.isAdminOrGlobalMod(req.uid, next);
|
|
|
|
|
},
|
|
|
|
|
function (isAdminOrGlobalMod, next) {
|
|
|
|
|
if (!isAdminOrGlobalMod) {
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
usersController.registrationQueue(req, res, next);
|
|
|
|
|
},
|
|
|
|
|
], next);
|
|
|
|
|
};
|