You are here

function _entityform_anonymous_user_submitted_form in Entityform 7.2

Utility function to determine if current user submitted the form.

Currently only supports query string token

Parameters

$entityform:

Return value

bool

1 call to _entityform_anonymous_user_submitted_form()
entityform_anonymous_entityform_access_alter in entityform_anonymous/entityform_anonymous.module
Implements hook_entityform_access_alter().

File

entityform_anonymous/entityform_anonymous.module, line 131
Main functions and hook implementations

Code

function _entityform_anonymous_user_submitted_form($entityform) {
  if (user_is_anonymous()) {
    $entityform_type = entityform_type_load($entityform->type);
    if (!empty($entityform_type->data['anonymous_links']) && !empty($_GET['token'])) {
      if ($_GET['token'] == _entityform_anonymous_get_token($entityform->entityform_id)) {
        return TRUE;
      }

      // @todo Message about bad token/link
    }
  }
}