mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
Bug 1744 fixed : Incorrect use of timezone with SQLite
Fixed anti-flood system. Need refactoring between each interval functions git-svn-id: http://piwigo.org/svn/trunk@6604 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
fb1d1c43d6
commit
1ba096945f
6 changed files with 28 additions and 7 deletions
|
@ -133,12 +133,14 @@ SELECT COUNT(*) AS user_exists
|
|||
|
||||
if ($comment_action!='reject' and $conf['anti-flood_time']>0 )
|
||||
{ // anti-flood system
|
||||
$reference_date = date('c', time() - $conf['anti-flood_time']);
|
||||
$reference_date = pwg_db_get_flood_period_expression($conf['anti-flood_time']);
|
||||
|
||||
$query = '
|
||||
SELECT id FROM '.COMMENTS_TABLE.'
|
||||
WHERE date > \''.$reference_date.'\'
|
||||
SELECT count(1) FROM '.COMMENTS_TABLE.'
|
||||
WHERE date > '.$reference_date.'
|
||||
AND author_id = '.$comm['author_id'];
|
||||
if ( pwg_db_num_rows( pwg_query( $query ) ) > 0 )
|
||||
list($counter) = pwg_db_fetch_row(pwg_query($query));
|
||||
if ( $counter > 0 )
|
||||
{
|
||||
array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') );
|
||||
$comment_action='reject';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue