Ignore:
Timestamp:
Jun 24, 2012, 1:49:50 PM (12 years ago)
Author:
mistic100
Message:

improve anti-spam system (Piwigo 2.5 feature)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/include/functions_comment.inc.php

    r15640 r15995  
    104104    $_POST['cr'][] = 'key';
    105105  }
     106 
     107  // anonymous id = ip address
     108  $ip_components = explode('.', $comm['ip']);
     109  if (count($ip_components) > 3)
     110  {
     111    array_pop($ip_components);
     112  }
     113  $comm['anonymous_id'] = implode('.', $ip_components);
    106114
    107115  if ($comment_action!='reject' and $conf['anti-flood_time']>0 and !is_admin())
     
    113121  WHERE date > '.$reference_date.'
    114122    AND author_id = '.$comm['author_id'];
     123    if (!is_classic_user())
     124    {
     125      $query.= '
     126      AND anonymous_id = "'.$comm['anonymous_id'].'"';
     127    }
     128    $query.= '
     129;';
     130
    115131    list($counter) = pwg_db_fetch_row(pwg_query($query));
    116132    if ( $counter > 0 )
Note: See TracChangeset for help on using the changeset viewer.