ban duration fix

merge-requests/208/head
fatchan 5 years ago
parent f279b61484
commit 4b4d3a0a7d
  1. 2
      models/forms/banposter.js

@ -6,7 +6,7 @@ const { Bans } = require(__dirname+'/../../db/')
module.exports = async (req, res, next) => {
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 allowAppeal = (req.body.no_appeal || req.body.ban_q || req.body.ban_h) ? false : true; //dont allow appeals for range bans

Loading…
Cancel
Save