You are here

function securepages_match_form in Secure Pages 7

Check form Id to see if this form should be secured.

1 call to securepages_match_form()
securepages_form_alter in ./securepages.module
Implements hook_form_alter().

File

./securepages.module, line 355
Allows certain pages to be viewable only via HTTPS.

Code

function securepages_match_form($form_id, $args = array()) {
  $forms =& drupal_static(__FUNCTION__);
  if (drupal_match_path($form_id, variable_get('securepages_forms', SECUREPAGES_FORMS))) {
    securepages_log('Secure Form (Form: "@path", Line: @line, Pattern: "@pattern")', $form_id, variable_get('securepages_forms', SECUREPAGES_FORMS));
    return TRUE;
  }
  if (!isset($forms)) {
    $forms = module_invoke_all('forms', $form_id, $args);
  }
  if (isset($forms[$form_id])) {
    $form_definition = $forms[$form_id];
    if (drupal_match_path($form_definition['callback'], variable_get('securepages_forms', SECUREPAGES_FORMS))) {
      securepages_log('Secure Form (Path: "@path", Line: @line, Pattern: "@pattern")', $form_definition['callback'], variable_get('securepages_forms', SECUREPAGES_FORMS));
      return TRUE;
    }
  }
  return FALSE;
}