|
|
@ -6,7 +6,7 @@ const { Bans } = require(__dirname+'/../../db/') |
|
|
|
module.exports = async (req, res, next) => { |
|
|
|
module.exports = async (req, res, next) => { |
|
|
|
|
|
|
|
|
|
|
|
const banDate = new Date(); |
|
|
|
const banDate = new Date(); |
|
|
|
const banExpiry = new Date(req.body.ban_duration ? banDate.getTime() + req.body.ban_duration : defaultBanDuration); //perm if none or malformed input
|
|
|
|
const banExpiry = new Date(banDate.getTime() + (req.body.ban_duration || defaultBanDuration)); //uses config default if missing or malformed
|
|
|
|
const banReason = req.body.ban_reason || req.body.log_message || 'No reason specified'; |
|
|
|
const banReason = req.body.ban_reason || req.body.log_message || 'No reason specified'; |
|
|
|
const allowAppeal = (req.body.no_appeal || req.body.ban_q || req.body.ban_h) ? false : true; //dont allow appeals for range bans
|
|
|
|
const allowAppeal = (req.body.no_appeal || req.body.ban_q || req.body.ban_h) ? false : true; //dont allow appeals for range bans
|
|
|
|
|
|
|
|
|
|
|
|