From b21189f7623f98652fb803e87520a115282c72d6 Mon Sep 17 00:00:00 2001 From: fatchan Date: Tue, 2 Jun 2020 17:33:12 +1000 Subject: [PATCH] Change the wording of that because it wouldnt be correct for ipv6 --- models/forms/banposter.js | 10 +++++----- models/forms/editpost.js | 2 +- models/forms/makepost.js | 2 +- views/mixins/ban.pug | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/models/forms/banposter.js b/models/forms/banposter.js index 3f23c7ba..1d19a2d3 100644 --- a/models/forms/banposter.js +++ b/models/forms/banposter.js @@ -23,20 +23,20 @@ module.exports = async (req, res, next) => { }, {}); for (let ip in ipPosts) { const thisIpPosts = ipPosts[ip]; - let subnet = '/32'; + let type = 'single'; let banIp = { single: ip, raw: thisIpPosts[0].ip.raw }; if (req.body.ban_h) { - subnet = '/16'; + type = 'half'; banIp.single = thisIpPosts[0].ip.hrange; } else if (req.body.ban_q) { - subnet = '/24'; + type = 'quarter'; banIp.single = thisIpPosts[0].ip.qrange; } bans.push({ - subnet, + type, 'ip': banIp, 'reason': banReason, 'board': banBoard, @@ -74,7 +74,7 @@ module.exports = async (req, res, next) => { [...new Set(ips)].forEach(ip => { bans.push({ 'ip': ip, - 'subnet': '/32', + 'type': 'single', 'reason': banReason, 'board': banBoard, 'posts': null, diff --git a/models/forms/editpost.js b/models/forms/editpost.js index 443f888e..2e46ce3c 100644 --- a/models/forms/editpost.js +++ b/models/forms/editpost.js @@ -52,7 +52,7 @@ todo: handle some more situations 'single': res.locals.ip.single, 'raw': res.locals.ip.raw, }, - 'subnet': '/32', + 'type': 'single', 'reason': 'global word filter auto ban', 'board': null, 'posts': null, diff --git a/models/forms/makepost.js b/models/forms/makepost.js index bf46c34d..3109bd10 100644 --- a/models/forms/makepost.js +++ b/models/forms/makepost.js @@ -137,7 +137,7 @@ module.exports = async (req, res, next) => { 'single': res.locals.ip.single, 'raw': res.locals.ip.raw, }, - 'subnet': '/32', + 'type': 'single', 'reason': `${hitGlobalFilter ? 'global ' :''}word filter auto ban`, 'board': banBoard, 'posts': null, diff --git a/views/mixins/ban.pug b/views/mixins/ban.pug index 63152df4..235691d5 100644 --- a/views/mixins/ban.pug +++ b/views/mixins/ban.pug @@ -12,7 +12,7 @@ mixin ban(ban, banpage) td= ban.reason - const ip = permLevel > ipHashPermLevel ? ban.ip.single.slice(-10) : ban.ip.raw; td #{ip} - td #{ban.subnet} + td #{ban.type} td #{ban.issuer} - const banDate = new Date(ban.date); td: time.right.reltime(datetime=banDate.toISOString()) #{banDate.toLocaleString(undefined, {hour12:false})}