From: Simon McVittie Date: Sun, 12 Oct 2014 17:03:28 +0000 (+0100) Subject: comments: don't log remote IP address for signed-in users X-Git-Tag: debian/3.20141016~33 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/4e2bfe1e17b3bb142aef116e0731d5a8c36d8179?hp=08fd2e0806076803a354cd2ce167ba6f875358d5 comments: don't log remote IP address for signed-in users The intention was that signed-in users (for instance via httpauth, passwordauth or openid) are already adequately identified, but there's nothing to indicate who an anonymous commenter is unless their IP address is recorded. --- diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 98ae13810..c5177833f 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -468,12 +468,15 @@ sub editcomment ($$) { $username =~ s/"/"/g; $content .= " username=\"$username\"\n"; } + if (defined $session->param('nickname')) { my $nickname = $session->param('nickname'); $nickname =~ s/"/"/g; $content .= " nickname=\"$nickname\"\n"; } - elsif (defined $session->remote_addr()) { + + if (!(defined $session->param('name') || defined $session->param('nickname')) && + defined $session->remote_addr()) { $content .= " ip=\"".$session->remote_addr()."\"\n"; }