bot-safer contact form

This commit is contained in:
Ralf Becker 2008-05-07 13:16:09 +00:00
parent 3ca4300cca
commit 40e38dd400

View File

@ -37,7 +37,9 @@ class addressbook_contactform
if (is_array($content))
{
if (isset($content['captcha_result']) && $content['captcha'] != $content['captcha_result'])
if (isset($content['captcha_result']) && $content['captcha'] != $content['captcha_result'] || // no correct captcha OR
time() - $content['start_time'] < 10 && // bot indicator (less then 10 sec to fill out the form and
!$GLOBALS['egw_info']['etemplate']['java_script']) // javascript disabled)
{
$tpl->set_validation_error('captcha',lang('Wrong - try again ...'));
}
@ -121,6 +123,7 @@ class addressbook_contactform
$content['show'][$name] = true;
}
}
$preserv['start_time'] = time();
}
$content['addr_format'] = $GLOBALS['egw_info']['user']['preferences']['addressbook']['addr_format'];