+ $sql = 'select count(*) as cnt from tt_groups where '.$ip_part.' and created > now() - interval 10 minute';
+ $res = $mdb2->query($sql);
+ if (is_a($res, 'PEAR_Error'))
+ return false;
+ $val = $res->fetchRow();
+ if ($val['cnt'] == 0)
+ return false; // No registrations in last 10 minutes.
+ if ($val['cnt'] >= 2)
+ return true; // 2 or more registrations in last 10 mintes.
+
+ // If we are here, there was exactly one registration during last 10 minutes.
+ // Determine if it occurred within the last minute in a separate query.