aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2014-07-20 21:32:56 +0000
committerrvelices <rv-github@modusoptimus.com>2014-07-20 21:32:56 +0000
commit4047d8cc8b59df387c39e44f811a893b505603d4 (patch)
tree2461d3907c6f31e29d23d4e1101a6d5fe0647e8a /include
parentf35908237c3d5f4302b0e0504649b048aa3be70b (diff)
bug 3100 display IP address of comment author on admin page and also save the entire ip address in the database, not only the first three ip components
git-svn-id: http://piwigo.org/svn/trunk@29060 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions_comment.inc.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/functions_comment.inc.php b/include/functions_comment.inc.php
index 9bd0b9f25..2dcc4fcc1 100644
--- a/include/functions_comment.inc.php
+++ b/include/functions_comment.inc.php
@@ -173,13 +173,13 @@ SELECT COUNT(*) AS user_exists
{
$comm['email'] = $user['email'];
}
- else if ($conf['comments_email_mandatory'])
+ elseif ($conf['comments_email_mandatory'])
{
$infos[] = l10n('Email address is missing. Please specify an email address.');
$comment_action='reject';
}
}
- else if (!email_check_format($comm['email']))
+ elseif (!email_check_format($comm['email']))
{
$infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
$comment_action='reject';
@@ -191,7 +191,7 @@ SELECT COUNT(*) AS user_exists
{
array_pop($ip_components);
}
- $comm['anonymous_id'] = implode('.', $ip_components);
+ $anonymous_id = implode('.', $ip_components);
if ($comment_action!='reject' and $conf['anti-flood_time']>0 and !is_admin())
{ // anti-flood system
@@ -204,7 +204,7 @@ SELECT count(1) FROM '.COMMENTS_TABLE.'
if (!is_classic_user())
{
$query.= '
- AND anonymous_id = "'.$comm['anonymous_id'].'"';
+ AND anonymous_id LIKE "'.$anonymous_id.'.%"';
}
$query.= '
;';
@@ -231,7 +231,7 @@ INSERT INTO '.COMMENTS_TABLE.'
VALUES (
\''.$comm['author'].'\',
'.$comm['author_id'].',
- \''.$comm['anonymous_id'].'\',
+ \''.$comm['ip'].'\',
\''.$comm['content'].'\',
NOW(),
\''.($comment_action=='validate' ? 'true':'false').'\',