aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/comments.pm
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-10-12 18:03:28 +0100
committerSimon McVittie <smcv@debian.org>2014-10-12 18:03:28 +0100
commit4e2bfe1e17b3bb142aef116e0731d5a8c36d8179 (patch)
tree967ad07ce5bea1e480ee187d32be0fd7e965e85a /IkiWiki/Plugin/comments.pm
parent08fd2e0806076803a354cd2ce167ba6f875358d5 (diff)
downloadikiwiki-4e2bfe1e17b3bb142aef116e0731d5a8c36d8179.tar
ikiwiki-4e2bfe1e17b3bb142aef116e0731d5a8c36d8179.tar.gz
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.
Diffstat (limited to 'IkiWiki/Plugin/comments.pm')
-rw-r--r--IkiWiki/Plugin/comments.pm5
1 files changed, 4 insertions, 1 deletions
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/"/&quot;/g;
$content .= " username=\"$username\"\n";
}
+
if (defined $session->param('nickname')) {
my $nickname = $session->param('nickname');
$nickname =~ s/"/&quot;/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";
}