You are here

public function TfaTestSend::floodIsAllowed in Two-factor Authentication (TFA) 7.2

Check resend flood.

Parameters

int $window: Number of seconds in the time window for this event.

Return value

bool TRUE if resend flood was not reached, FALSE otherwise.

File

tests/includes/tfa_test.send.inc, line 73
Tests for the TfaSendPluginInterface.

Class

TfaTestSend
Class TfaTestSend.

Code

public function floodIsAllowed($window) {
  if (!flood_is_allowed('tfa_test_resend', variable_get('tfa_test_resend_threshold', 6), $window, $this->context['uid'])) {
    $this->errorMessages['code'] = t('Resend flood hit');
    return FALSE;
  }
  return TRUE;
}