You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var async = require('async');
|
|
|
|
|
|
|
|
var user = require('../user');
|
|
|
|
var adminBlacklistController = require('./admin/blacklist');
|
|
|
|
var usersController = require('./admin/users');
|
|
|
|
|
|
|
|
var globalModsController = module.exports;
|
|
|
|
|
|
|
|
globalModsController.ipBlacklist = function (req, res, next) {
|
|
|
|
async.waterfall([
|
|
|
|
function (next) {
|
|
|
|
user.isAdminOrGlobalMod(req.uid, next);
|
|
|
|
},
|
|
|
|
function (isAdminOrGlobalMod, next) {
|
|
|
|
if (!isAdminOrGlobalMod) {
|
|
|
|
return next();
|
|
|
|
}
|
|
|
|
adminBlacklistController.get(req, res, next);
|
|
|
|
},
|
|
|
|
], next);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|