v1.18.x
barisusakli 10 years ago
parent 64c0e1df61
commit ef3b6a2450

@ -2,6 +2,7 @@
var async = require('async'),
meta = require('../meta'),
db = require('../database'),
plugins = require('../plugins'),
user = require('../user'),
@ -46,6 +47,10 @@ module.exports = function(Posts) {
postData.toPid = data.toPid;
}
if (data.ip && parseInt(meta.config.trackIpPerPost, 10) === 1) {
postData.ip = data.ip;
}
plugins.fireHook('filter:post.save', postData, next);
},
function(postData, next) {

@ -250,7 +250,7 @@ Sockets.reqFromSocket = function(socket) {
referer = headers.referer || '';
return {
ip: socket.ip,
ip: headers['x-forwarded-for'] || socket.ip,
host: host,
protocol: socket.request.connection.encrypted ? 'https' : 'http',
secure: !!socket.request.connection.encrypted,

@ -226,7 +226,7 @@ module.exports = function(Topics) {
checkContentLength(content, next);
},
function(next) {
posts.create({uid: uid, tid: tid, content: content, toPid: toPid}, next);
posts.create({uid: uid, tid: tid, content: content, toPid: toPid, ip: data.req.ip}, next);
},
function(data, next) {
postData = data;

@ -41,6 +41,11 @@
<label>Minimum Post Length</label>
<input type="number" class="form-control" value="8" data-field="minimumPostLength">
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="trackIpPerPost"> <strong>Track IP Address for each post</strong>
</label>
</div>
</form>
</div>
</div>

Loading…
Cancel
Save