Change the wording of that because it wouldnt be correct for ipv6

merge-requests/208/head
fatchan 4 years ago
parent 7974f1d8c3
commit b21189f762
  1. 10
      models/forms/banposter.js
  2. 2
      models/forms/editpost.js
  3. 2
      models/forms/makepost.js
  4. 2
      views/mixins/ban.pug

@ -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,

@ -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,

@ -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,

@ -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})}

Loading…
Cancel
Save