Compare commits

...

10 Commits

  1. 6
      CHANGELOG.md
  2. 2
      controllers/forms/editbans.js
  3. 5
      lib/input/modlogactions.js
  4. 3
      locales/en-GB.json
  5. 3
      locales/it-IT.json
  6. 3
      locales/pt-BR.json
  7. 3
      locales/pt-PT.json
  8. 3
      locales/ru-RU.json
  9. 2
      models/forms/actionhandler.js
  10. 19
      models/forms/changeboardsettings.js
  11. 18
      models/forms/create.js
  12. 2
      views/includes/postform.pug
  13. 2
      views/mixins/ban.pug
  14. 6
      views/mixins/postlink.pug
  15. 11
      views/pages/globalmanagelogs.pug
  16. 2
      views/pages/managelogs.pug
  17. 2
      views/pages/modlog.pug

@ -1,5 +1,11 @@
### 1.6.0
- Filters now have a "replace" mode, by @disco.
- Global bans now show the board it originated from as "Global (<board>)".
- Modlogs now have private entries for staff auditing
- So far covers creating boards, changing board settings, and ban editing/unban/upgrade.
- Modlog entries for e.g. board creation are global and not linked to the board and will not be deleted along with the board (duh).
- Private modlogs for edited global bans will also be available from the originating board.
- Added a global setting that toggles whether board ban lists include global bans that originated from that board.
- Global account management now has an option delete all boards owned by an account when deleting it.
- Bugfix moving posts to non existing board not correctly returning an error sometimes.

@ -86,7 +86,7 @@ module.exports = {
board: Array.isArray(b.board) ? b.board.find(bx => bx != null) : b.board, //TODO: if in future multiple are allowed, update this to use an array
showLinks: true,
postLinks: [],
actions: [ModlogActions.BAN],
actions: [ModlogActions.EDIT_BAN],
public: false,
date: new Date(),
showUser: true,

@ -27,4 +27,9 @@ module.exports = Object.seal(Object.freeze(Object.preventExtensions({
STICKY: 'Sticky',
CYCLE: 'Cycle',
EDIT_BAN: 'Edit Ban',
SETTINGS: 'Settings',
CREATE_BOARD: 'Create Board',
DELETE_BOARD: 'Delete Board',
})));

@ -1427,5 +1427,6 @@
"Deleted %n records.": {
"one": "Deleted %s record.",
"other": "Deleted %n records."
}
},
"Created board /%s/": "Created board /%s/"
}

@ -1426,5 +1426,6 @@
"Deleted %n records.": {
"one": "Deleted %s record.",
"other": "Deleted %n records."
}
},
"Created board /%s/": "Created board /%s/"
}

@ -1430,5 +1430,6 @@
"Deleted %n records.": {
"one": "Deleted %s record.",
"other": "Deleted %n records."
}
},
"Created board /%s/": "Created board /%s/"
}

@ -1430,5 +1430,6 @@
"Deleted %n records.": {
"one": "Deleted %s record.",
"other": "Deleted %n records."
}
},
"Created board /%s/": "Created board /%s/"
}

@ -1501,5 +1501,6 @@
"Deleted %n records.": {
"one": "Deleted %s record.",
"other": "Deleted %n records."
}
},
"Created board /%s/": "Created board /%s/"
}

@ -330,7 +330,7 @@ module.exports = async (req, res, next) => {
//per board actions, all actions combined to one event
modlog[post.board] = {
showLinks: !deleting,
postLinks: [],
postLinks: [], //TODO: rename this to just "links"
actions: modlogActions,
public: true,
date: logDate,

@ -1,6 +1,7 @@
'use strict';
const { Boards, Posts } = require(__dirname+'/../../db/')
const { Boards, Posts, Modlogs } = require(__dirname+'/../../db/')
, ModlogActions = require(__dirname+'/../../lib/input/modlogactions.js')
, { debugLogs } = require(__dirname+'/../../configs/secrets.js')
, dynamicResponse = require(__dirname+'/../../lib/misc/dynamic.js')
, config = require(__dirname+'/../../lib/misc/config.js')
@ -223,6 +224,22 @@ module.exports = async (req, res) => {
}
});
promises.push(Modlogs.insertOne({
board: req.params.board,
showLinks: true,
postLinks: [],
actions: [ModlogActions.SETTINGS],
public: false,
date: new Date(),
showUser: true,
message: __('Updated settings.'),
user: req.session.user,
ip: {
cloak: res.locals.ip.cloak,
raw: res.locals.ip.raw,
}
}));
//finish the promises in parallel e.g. removing files
if (promises.length > 0) {
await Promise.all(promises);

@ -1,6 +1,7 @@
'use strict';
const { Boards, Accounts } = require(__dirname+'/../../db/')
const { Boards, Accounts, Modlogs } = require(__dirname+'/../../db/')
, ModlogActions = require(__dirname+'/../../lib/input/modlogactions.js')
, { Binary } = require(__dirname+'/../../db/db.js')
, dynamicResponse = require(__dirname+'/../../lib/misc/dynamic.js')
, roleManager = require(__dirname+'/../../lib/permission/rolemanager.js')
@ -65,6 +66,21 @@ module.exports = async (req, res) => {
};
await Promise.all([
Modlogs.insertOne({
board: null,
showLinks: true,
postLinks: [{ board: uri }],
actions: [ModlogActions.CREATE_BOARD],
public: false,
date: new Date(),
showUser: true,
message: __('Created board /%s/', uri),
user: req.session.user,
ip: {
cloak: res.locals.ip.cloak,
raw: res.locals.ip.raw,
}
}),
Boards.insertOne(newBoard),
Accounts.addOwnedBoard(owner, uri),
ensureDir(`${uploadDirectory}/html/${uri}`),

@ -39,7 +39,7 @@ section.form-wrapper.flex-center
span.required *
- const minLength = (isThread ? board.settings.minReplyMessageLength : board.settings.minThreadMessageLength) || 0;
- const maxLength = Math.min((isThread ? board.settings.maxReplyMessageLength : board.settings.maxThreadMessageLength), globalLimits.fieldLength.message) || globalLimits.fieldLength.message;
textarea#message(name='message', rows='5', autocomplete='off' minlength=minLength maxlength=maxLength required=messageRequired)
textarea#message(name='message', rows='5', minlength=minLength maxlength=maxLength required=messageRequired)
if board.settings.maxFiles > 0 && Object.values(board.settings.allowedFileTypes).some(x => x === true)
- const maxFiles = board.settings.maxFiles;
section.row

@ -3,7 +3,7 @@ include ./post.pug
mixin ban(ban, banpage)
tr
td
if !banpage || (ban.appeal == null && ban.allowAppeal === true)
if (!board || !ban.global) && (!banpage || (ban.appeal == null && ban.allowAppeal === true))
input.post-check(type='checkbox', name='checkedbans' value=ban._id)
td
if ban.global === true

@ -1,2 +1,6 @@
mixin postlink(log, postLink, manageLink=false)
a.quote(href=`/${postLink.board || log.board}/${manageLink ? 'manage/' : ''}thread/${postLink.thread || postLink.postId}.html#${postLink.postId}`) &gt;&gt;#{postLink.postId}
if postLink.thread || postLink.postId
a.quote(href=`/${postLink.board || log.board}/${manageLink ? 'manage/' : ''}thread/${postLink.thread || postLink.postId}.html#${postLink.postId}`) &gt;&gt;#{postLink.postId}
else
a.quote(href=`/${postLink.board || log.board}/${manageLink ? 'manage/' : ''}index.html`) &gt;&gt;&gt;/#{postLink.board}/

@ -35,16 +35,19 @@ block content
th #{__('User')}
th #{__('IP')}
th #{__('Actions')}
th #{__('Posts')}
th #{__('Links')}
th #{__('Log Message')}
for log in logs
tr
- const logDate = new Date(log.date);
td: time.reltime(datetime=logDate.toISOString()) #{logDate.toLocaleString(pageLanguage, {hourCycle:'h23'})}
td
a(href=`/${log.board}/index.html`) /#{log.board}/
|
a(href=`?uri=${log.board}`) [+]
if log.board
a(href=`/${log.board}/index.html`) /#{log.board}/
|
a(href=`?uri=${log.board}`) [+]
else
| -
td
if log.user !== __('Unregistered User')
a(href=`accounts.html?username=${log.user}`) #{log.user}

@ -30,7 +30,7 @@ block content
th #{__('User')}
th #{__('IP')}
th #{__('Actions')}
th #{__('Posts')}
th #{__('Links')}
th #{__('Log Message')}
for log in logs
tr

@ -19,7 +19,7 @@ block content
th #{__('Date')}
th #{__('User')}
th #{__('Actions')}
th #{__('Posts')}
th #{__('Links')}
th #{__('Log Message')}
for log in logs
tr

Loading…
Cancel
Save