register.html/create.html hiding based on settings and fix broken captcha quota resetting for some forms references #124

merge-requests/208/head
fatchan 4 years ago
parent a6e6f1d244
commit 5c7fc003ad
  1. 6
      configs/main.js.example
  2. 8
      controllers/forms.js
  3. 5
      views/pages/account.pug
  4. 3
      views/pages/changepassword.pug
  5. 4
      views/pages/home.pug
  6. 3
      views/pages/login.pug

@ -90,9 +90,9 @@ module.exports = {
enableWebring: false,
//let all users create new boards
enableUserBoardCreation: true,
//allow new accounts to be created
enableUserAccountCreation: true,
enableUserBoards: true,
//let all users register new accounts
enableAccountCreation: true,
/* extension for thumbnails. this value is used UNLESS the image contains transparency,
in which case png is used. */

@ -111,17 +111,17 @@ router.post('/global/editaccounts', sessionRefresh, csrf, calcPerms, isLoggedIn,
router.post('/global/settings', sessionRefresh, csrf, calcPerms, isLoggedIn, hasPerms(0), paramConverter, globalSettingsController); //global settings
//create board
router.post('/create', sessionRefresh, isLoggedIn, verifyCaptcha, calcPerms, hasPerms(4), createBoardController);
router.post('/create', processIp, sessionRefresh, isLoggedIn, verifyCaptcha, calcPerms, hasPerms(4), createBoardController);
//accounts
router.post('/login', loginController);
router.post('/logout', logout);
router.post('/register', verifyCaptcha, calcPerms, registerController);
router.post('/changepassword', verifyCaptcha, changePasswordController);
router.post('/register', processIp, verifyCaptcha, calcPerms, registerController);
router.post('/changepassword', processIp, verifyCaptcha, changePasswordController);
//removes captcha cookie, for refreshing for noscript users
router.post('/newcaptcha', newCaptcha);
//solve captcha for block bypass
router.post('/blockbypass', verifyCaptcha, blockBypass);
router.post('/blockbypass', processIp, verifyCaptcha, blockBypass);
module.exports = router;

@ -13,7 +13,10 @@ block content
ul
if user.authLevel <= 1
li: a(href='/globalmanage/recent.html') Global management
li: a(href='/create.html') Create a board
if enableUserBoards || user.authLevel <= 1
li: a(href='/create.html') Create a board
if !userAccountCreation && user.authLevel <= 1
li: a(href='/register.html') Register an account
li: a(href='/changepassword.html') Change password
form(action='/forms/logout' method='post')
input(type='submit' value='Log out')

@ -25,4 +25,5 @@ block content
include ../includes/captcha.pug
input(type='submit', value='Change Password')
p: a(href='/login.html') Login
p: a(href='/register.html') Register
if enableAccountCreation
p: a(href='/register.html') Register

@ -12,9 +12,7 @@ block content
tr
td
pre.no-m-p
| This is an anonymous imageboard, a type of BBS where anyone can post messages and share images.
| You don't need to register or provide any personal information to make a post.
| Choose a board below to join the discussion, or #[a(href='/create.html') create your own].
| The site administrator should edit views/pages/home.pug, then run "pm2 reload all" and "gulp html" to customise this page.
if recentNews && recentNews.length > 0
.table-container.flex-center.mv-5
table.newstable

@ -15,6 +15,7 @@ block content
.label Password
input(type='password', name='password', maxlength='100' required)
input(type='submit', value='submit')
p: a(href='/register.html') Register
if enableAccountCreation
p: a(href='/register.html') Register
p: a(href='/changepassword.html') Change Password

Loading…
Cancel
Save