Log board settings changes (non public)

merge-requests/345/head
Thomas Lynch 2 weeks ago
parent 9ba3b022be
commit 812e0fd3be
  1. 2
      models/forms/actionhandler.js
  2. 19
      models/forms/changeboardsettings.js

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

Loading…
Cancel
Save