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