drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.",array('%limit'=>$limit,'@interval'=>format_interval($window))),'error');
drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.",array('%limit'=>$limit,'@interval'=>format_interval($interval))),'error');
thrownewAccessDeniedHttpException();
}
...
...
@@ -180,7 +181,7 @@ function contact_site_form_submit($form, &$form_state) {
watchdog('mail','%sender-name (@sender-from) sent an e-mail regarding %category.',array('%sender-name'=>$values['name'],'@sender-from'=>$from,'%category'=>$values['category']['category']));
// Jump to home page rather than back to contact page to avoid
...
...
@@ -201,10 +202,11 @@ function contact_personal_form($form, &$form_state, $recipient) {
global$user;
// Check if flood control has been activated for sending e-mails.
drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.",array('%limit'=>$limit,'@interval'=>format_interval($window))),'error');
drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.",array('%limit'=>$limit,'@interval'=>format_interval($interval))),'error');
thrownewAccessDeniedHttpException();
}
...
...
@@ -315,7 +317,7 @@ function contact_personal_form_submit($form, &$form_state) {
watchdog('mail','%sender-name (@sender-from) sent %recipient-name an e-mail.',array('%sender-name'=>$values['name'],'@sender-from'=>$from,'%recipient-name'=>$values['recipient']->name));
$this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.',array('%number'=>$flood_limit,'@interval'=>format_interval(variable_get('contact_threshold_window',3600)))),'Normal user denied access to flooded contact form.');
$this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.',array('%number'=>$flood_limit,'@interval'=>format_interval(config('contact.settings')->get('flood.interval')))),'Normal user denied access to flooded contact form.');
// Test that the admin user can still access the contact form even though
@@ -158,7 +160,7 @@ function testSiteWideContact() {
// Submit contact form one over limit.
$this->drupalGet('contact');
$this->assertResponse(403,t('Access denied to anonymous user after reaching message treshold.'));
$this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.',array('%number'=>variable_get('contact_threshold_limit',3),'@interval'=>format_interval(600))),t('Message threshold reached.'));
$this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.',array('%number'=>config('contact.settings')->get('flood.limit'),'@interval'=>format_interval(600))),t('Message threshold reached.'));