| version 1.72, 2012/10/25 08:09:16 |
version 1.73, 2013/07/24 07:01:14 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/db.inc.php,v 1.71 2012-10-10 18:28:51 igor Exp $ */ |
/* $Platon: Metafox/db.inc.php,v 1.72 2012-10-25 08:09:16 igor Exp $ */ |
| |
|
| /* |
/* |
| * updates: 23/5/2001, 29/7/2001, 11/10/2001, 2/11/2001, 11/1/2002, 23/7/2002 |
* updates: 23/5/2001, 29/7/2001, 11/10/2001, 2/11/2001, 11/1/2002, 23/7/2002 |
| Line 2094 function ezin_save_email($section_id, $e |
|
| Line 2094 function ezin_save_email($section_id, $e |
|
| } /* }}} */ |
} /* }}} */ |
| |
|
| /* |
/* |
| |
* ezin_check_feedback_flood() |
| |
*/ |
| |
|
| |
function ezin_check_feedback_flood() /* {{{ */ |
| |
{ |
| |
global $ezin_sys; |
| |
global $ezin_cfg; |
| |
global $ezin_db_handle; |
| |
|
| |
$timeout = intval($ezin_cfg['feedback_flood_timeout']); |
| |
if ($timeout <= 0) |
| |
return 0; // no flood |
| |
|
| |
$ip = ezin_get_remote_addr(); |
| |
|
| |
$query = 'SELECT count(*) ' |
| |
.' FROM ' . $ezin_sys['db']['tables']['feedbacks'] |
| |
.' WHERE ip LIKE "'.ezin_db_escape($ip).'%"' |
| |
.' AND UNIX_TIMESTAMP(SYSDATE()) - UNIX_TIMESTAMP(datetime)' |
| |
.' <= '.$timeout; |
| |
|
| |
$result = @mysql_query($query, $ezin_db_handle) |
| |
or ezin_db_error('ezin_check_feedback_flood()'); |
| |
|
| |
if (($row = @mysql_fetch_array($result, MYSQL_NUM)) == false) |
| |
$row[0] = 0; |
| |
@mysql_free_result($result); |
| |
|
| |
return $row[0]; // 0 - no flooder detected, > 0 - flooders count |
| |
} /* }}} */ |
| |
|
| |
/* |
| * CACHE RELATED FUNCTIONS |
* CACHE RELATED FUNCTIONS |
| */ |
*/ |
| |
|