diff --git a/controllers/forms.js b/controllers/forms.js index e5861569..dacac6e5 100644 --- a/controllers/forms.js +++ b/controllers/forms.js @@ -288,7 +288,7 @@ router.post('/board/:board/actions', Boards.exists, banCheck, paramConverter, ve //make sure they checked 1-10 posts if (!req.body.checkedposts || req.body.checkedposts.length === 0 || req.body.checkedposts.length > 10) { - errors.push('Must select 1-10 posts') + errors.push('Must select 1-10 posts'); } //get what type of actions @@ -296,12 +296,12 @@ router.post('/board/:board/actions', Boards.exists, banCheck, paramConverter, ve //make sure they selected at least 1 action if (!anyValid) { - errors.push('No actions selected') + errors.push('No actions selected'); } //check if they have permission to perform the actions const hasPerms = checkPerms(req, res); if(!hasPerms && anyAuthed) { - errors.push('No permission') + errors.push('No permission'); } //check that actions are valid @@ -315,7 +315,7 @@ router.post('/board/:board/actions', Boards.exists, banCheck, paramConverter, ve errors.push('Ban reason must be 50 characters or less'); } if ((req.body.report || req.body.global_report) && (!req.body.report_reason || req.body.report_reason.length === 0)) { - errors.push('Reports must have a reason') + errors.push('Reports must have a reason'); } if (errors.length > 0) { @@ -382,6 +382,7 @@ router.post('/board/:board/actions', Boards.exists, banCheck, paramConverter, ve messages.push(message); } } + //TODO: IP-based deletes here. will need to gather all thread/board/global posts by IP, then run them through deletePosts if (req.body.delete) { const { message } = await deletePosts(req, res, next, passwordPosts, req.params.board); messages.push(message); @@ -596,6 +597,7 @@ router.post('/global/actions', checkPermsMiddleware, paramConverter, async(req, } messages.push(message); } + //TODO: IP-based deletes here. will need to gather all thread/board/global posts by IP, then run them through deletePosts if (req.body.delete) { const { message } = await deletePosts(req, res, next, posts); messages.push(message); diff --git a/helpers/actionchecker.js b/helpers/actionchecker.js index 5a823e41..784c2e13 100644 --- a/helpers/actionchecker.js +++ b/helpers/actionchecker.js @@ -8,6 +8,9 @@ const actions = [ {name:'global_report', global:false, auth:false, passwords:false}, {name:'spoiler', global:true, auth:false, passwords:true}, {name:'delete', global:true, auth:false, passwords:true}, + {name:'delete_ip_thread', global:true, auth:true, passwords:false}, + {name:'delete_ip_board', global:true, auth:true, passwords:false}, + {name:'delete_ip_global', global:true, auth:true, passwords:false}, {name:'delete_file', global:true, auth:false, passwords:true}, {name:'dismiss', global:false, auth:true, passwords:false}, {name:'global_dismiss', global:true, auth:true, passwords:false}, diff --git a/views/includes/actionfooter.pug b/views/includes/actionfooter.pug index ee79bb4d..3ea0aa20 100644 --- a/views/includes/actionfooter.pug +++ b/views/includes/actionfooter.pug @@ -24,6 +24,15 @@ label.toggle-label Toggle Post Actions input#report(type='text', name='report_reason', placeholder='report reason' autocomplete='off') .actions h4.no-m-p Mod Actions: + label + input.post-check(type='checkbox', name='delete_ip_thread' value=1) + | Delete IP+ thread + label + input.post-check(type='checkbox', name='delete_ip_board' value=1) + | Delete IP+ board + label + input.post-check(type='checkbox', name='delete_ip_global' value=1) + | Delete IP+ global label input.post-check(type='checkbox', name='sticky' value=1) | Sticky diff --git a/views/includes/actionfooter_globalmanage.pug b/views/includes/actionfooter_globalmanage.pug index e482ae80..6adec277 100644 --- a/views/includes/actionfooter_globalmanage.pug +++ b/views/includes/actionfooter_globalmanage.pug @@ -16,6 +16,15 @@ label.toggle-label Toggle Post Actions input#report(type='text', name='report_reason', placeholder='report reason' autocomplete='off') .actions h4.no-m-p Mod Actions: + label + input.post-check(type='checkbox', name='delete_ip_thread' value=1) + | Delete IP+ thread + label + input.post-check(type='checkbox', name='delete_ip_board' value=1) + | Delete IP+ board + label + input.post-check(type='checkbox', name='delete_ip_global' value=1) + | Delete IP+ global label input.post-check(type='checkbox', name='global_dismiss' value=1) | Dismiss Global Reports diff --git a/views/includes/actionfooter_manage.pug b/views/includes/actionfooter_manage.pug index 86b17479..d51d2c60 100644 --- a/views/includes/actionfooter_manage.pug +++ b/views/includes/actionfooter_manage.pug @@ -21,6 +21,9 @@ label.toggle-label Toggle Post Actions input#report(type='text', name='report_reason', placeholder='report reason' autocomplete='off') .actions h4.no-m-p Mod Actions: + label + input.post-check(type='checkbox', name='delete_ip_board' value=1) + | Delete IP+ board label input.post-check(type='checkbox', name='dismiss' value=1) | Dismiss Reports