diff --git a/src/meta/themes.js b/src/meta/themes.js index 9bca68c431..161ccc7f04 100644 --- a/src/meta/themes.js +++ b/src/meta/themes.js @@ -9,6 +9,7 @@ var async = require('async'); var file = require('../file'); var db = require('../database'); +var events = require('../events'); module.exports = function (Meta) { Meta.themes = {}; @@ -114,6 +115,14 @@ module.exports = function (Meta) { // Re-set the themes path (for when NodeBB is reloaded) Meta.themes.setPath(config); }, + function (next) { + events.log({ + type: 'theme-set', + uid: parseInt(data.uid, 10) || 0, + ip: data.ip || '127.0.0.1', + text: data.id, + }, next); + }, ], callback); Meta.reloadRequired = true; diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index 26e0c23690..43216575bc 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -112,6 +112,10 @@ SocketAdmin.themes.set = function (socket, data, callback) { } }, function (next) { + // Add uid and ip data + data.ip = socket.ip; + data.uid = socket.uid; + meta.themes.set(data, next); }, ], callback);