aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-12-19 14:12:51 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-12-19 14:12:51 +0000
commitcc3d50adbb5b1aa5606e11d84b9c66c394bf1569 (patch)
tree079222f730fbfe6660b1426c09fe5735fccc71a1 /phpBB/posting.php
parent3d33692557b8092ed3df34559b25d688638901c5 (diff)
downloadforums-cc3d50adbb5b1aa5606e11d84b9c66c394bf1569.tar
forums-cc3d50adbb5b1aa5606e11d84b9c66c394bf1569.tar.gz
forums-cc3d50adbb5b1aa5606e11d84b9c66c394bf1569.tar.bz2
forums-cc3d50adbb5b1aa5606e11d84b9c66c394bf1569.tar.xz
forums-cc3d50adbb5b1aa5606e11d84b9c66c394bf1569.zip
Fix for bug #494982, uses IP for anonymous posters and user_id for logged in users
git-svn-id: file:///svn/phpbb/trunk@1632 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 2309e72977..198eba2bd7 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1182,9 +1182,10 @@ if( ( $submit || $confirm || $mode == "delete" ) && !$error )
//
// Flood control
//
+ $where_sql = ( $userdata['user_id'] == ANONYMOUS ) ? "poster_ip = '$user_ip'" : "poster_id = " . $userdata['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
- WHERE poster_ip = '$user_ip'";
+ WHERE $where_sql";
if($result = $db->sql_query($sql))
{
$db_row = $db->sql_fetchrow($result);