@ -330,7 +330,7 @@ router.post('/board/:board/post', Boards.exists, banCheck, postFiles, paramConve
} ) ;
} ) ;
//board settings
//board settings
router . post ( '/board/:board/settings' , csrf , Boards . exists , isLoggedIn , checkPermsMiddleware ( 2 ) , paramConverter , async ( req , res , next ) => {
router . post ( '/board/:board/settings' , csrf , Boards . exists , banCheck , isLoggedIn , checkPermsMiddleware ( 2 ) , paramConverter , async ( req , res , next ) => {
const errors = [ ] ;
const errors = [ ] ;
@ -361,11 +361,11 @@ router.post('/board/:board/settings', csrf, Boards.exists, isLoggedIn, checkPerm
if ( typeof req . body . captcha _mode === 'number' && ( req . body . captcha _mode < 0 || req . body . captcha _mode > 2 ) ) {
if ( typeof req . body . captcha _mode === 'number' && ( req . body . captcha _mode < 0 || req . body . captcha _mode > 2 ) ) {
errors . push ( 'Invalid captcha mode.' ) ;
errors . push ( 'Invalid captcha mode.' ) ;
}
}
if ( typeof req . body . captcha _trigger === 'number' && ( req . body . captcha _trigger < 0 || req . body . captcha _trigger > 10000 ) ) {
if ( typeof req . body . tph _trigger === 'number' && ( req . body . tph _trigger < 0 || req . body . tph _trigger > 10000 ) ) {
errors . push ( 'Invalid captcha trigger threshold.' ) ;
errors . push ( 'Invalid tph trigger threshold.' ) ;
}
}
if ( typeof req . body . captcha _trigger _mode === 'number' && ( req . body . captcha _trigger _mode < 0 || req . body . captcha _trigger _mode > 2 ) ) {
if ( typeof req . body . tph _trigger _action === 'number' && ( req . body . tph _trigger _action < 0 || req . body . tph _trigger _action > 3 ) ) {
errors . push ( 'Invalid captcha trigger mode .' )
errors . push ( 'Invalid tph trigger action .' )
}
}
if ( typeof req . body . filter _mode === 'number' && ( req . body . filter _mode < 0 || req . body . filter _mode > 2 ) ) {
if ( typeof req . body . filter _mode === 'number' && ( req . body . filter _mode < 0 || req . body . filter _mode > 2 ) ) {
errors . push ( 'Invalid filter mode.' ) ;
errors . push ( 'Invalid filter mode.' ) ;
@ -391,7 +391,7 @@ router.post('/board/:board/settings', csrf, Boards.exists, isLoggedIn, checkPerm
} ) ;
} ) ;
//upload banners
//upload banners
router . post ( '/board/:board/addbanners' , bannerFiles , csrf , Boards . exists , isLoggedIn , checkPermsMiddleware ( 2 ) , paramConverter , async ( req , res , next ) => {
router . post ( '/board/:board/addbanners' , bannerFiles , csrf , Boards . exists , banCheck , isLoggedIn , checkPermsMiddleware ( 2 ) , paramConverter , async ( req , res , next ) => {
if ( req . files && req . files . file ) {
if ( req . files && req . files . file ) {
if ( Array . isArray ( req . files . file ) ) {
if ( Array . isArray ( req . files . file ) ) {
@ -430,7 +430,7 @@ router.post('/board/:board/addbanners', bannerFiles, csrf, Boards.exists, isLogg
} ) ;
} ) ;
//delete banners
//delete banners
router . post ( '/board/:board/deletebanners' , csrf , Boards . exists , isLoggedIn , checkPermsMiddleware ( 2 ) , paramConverter , async ( req , res , next ) => {
router . post ( '/board/:board/deletebanners' , csrf , Boards . exists , banCheck , isLoggedIn , checkPermsMiddleware ( 2 ) , paramConverter , async ( req , res , next ) => {
const errors = [ ] ;
const errors = [ ] ;
@ -467,7 +467,7 @@ router.post('/board/:board/deletebanners', csrf, Boards.exists, isLoggedIn, chec
//actions for a specific board
//actions for a specific board
router . post ( '/board/:board/actions' , Boards . exists , banCheck , paramConverter , verifyCaptcha , boardActionController ) ; //Captcha on regular actions
router . post ( '/board/:board/actions' , Boards . exists , banCheck , paramConverter , verifyCaptcha , boardActionController ) ; //Captcha on regular actions
router . post ( '/board/:board/modactions' , csrf , Boards . exists , isLoggedIn , checkPermsMiddleware ( 3 ) , paramConverter , boardActionController ) ; //CSRF for mod actions
router . post ( '/board/:board/modactions' , csrf , Boards . exists , banCheck , isLoggedIn , checkPermsMiddleware ( 3 ) , paramConverter , boardActionController ) ; //CSRF for mod actions
async function boardActionController ( req , res , next ) {
async function boardActionController ( req , res , next ) {
const errors = [ ] ;
const errors = [ ] ;
@ -596,7 +596,7 @@ async function globalActionController(req, res, next) {
}
}
//unban
//unban
router . post ( '/board/:board/unban' , csrf , Boards . exists , isLoggedIn , checkPermsMiddleware ( 3 ) , paramConverter , async ( req , res , next ) => {
router . post ( '/board/:board/unban' , csrf , Boards . exists , banCheck , isLoggedIn , checkPermsMiddleware ( 3 ) , paramConverter , async ( req , res , next ) => {
//keep this for later in case i add other options to unbans
//keep this for later in case i add other options to unbans
const errors = [ ] ;
const errors = [ ] ;