Define maximum number of registrations allowed per IP within 24 hours
Add this code to site.php file:
Am_Di::getInstance()->hook->add(Am_Event::VALIDATE_SAVED_FORM, function(Am_Event $e) {
if ($e->getDi()->auth->getUserId()) return;
$reg_max = 10;
$reg_num = $e->getDi()->db->selectCell("SELECT COUNT(*) FROM ?_user WHERE remote_addr = ? AND added>?",
$_SERVER['REMOTE_ADDR'], sqlTime('- 24 hours'));
if ($reg_num > $reg_max) {
$e->addError(___('Registration from you IP is temporary disabled'));
}
});