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';
|
|
|
|
|
|
|
|
const user = require('../user');
|
|
|
|
const adminBlacklistController = require('./admin/blacklist');
|
|
|
|
const usersController = require('./admin/users');
|
|
|
|
|
|
|
|
const globalModsController = module.exports;
|
|
|
|
|
|
|
|
globalModsController.ipBlacklist = async function (req, res, next) {
|
|
|
|
const isAdminOrGlobalMod = await user.isAdminOrGlobalMod(req.uid);
|
|
|
|
if (!isAdminOrGlobalMod) {
|
|
|
|
return next();
|
|
|
|
}
|
|
|
|
await adminBlacklistController.get(req, res);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
globalModsController.registrationQueue = async function (req, res, next) {
|
|
|
|
const isAdminOrGlobalMod = await user.isAdminOrGlobalMod(req.uid);
|
|
|
|
if (!isAdminOrGlobalMod) {
|
|
|
|
return next();
|
|
|
|
}
|
|
|
|
await usersController.registrationQueue(req, res);
|
|
|
|
};
|