You are here

function securesite_form_alter in Secure Site 8

Same name and namespace in other branches
  1. 7.2 securesite.module \securesite_form_alter()

Implements hook_form_alter().

File

./securesite.module, line 115
Enables HTTP authentication or an HTML form to restrict site access.

Code

function securesite_form_alter(&$form, $form_state, $form_id) {
  if (in_array($form_id, array(
    'user_register_form',
    'user_profile_form',
  ))) {
    $form['#validate'][] = 'securesite_user_validate';
  }
  else {
    if (in_array($form_id, array(
      "user_login_form",
    ))) {
      $form['#submit'][] = 'securesite_user_login_submit';
    }
    else {
      if (in_array($form_id, array(
        "user_form",
      ))) {
        $form['actions']['submit']['#submit'][] = "securesite_user_form_submit";
      }
      else {
        if (in_array($form_id, array(
          "user_pass",
        ))) {
          $form['#theme'] = 'securesite_user_pass';
          $form['name']['#title'] = t('User name or e-mail address');
          $form['#redirect'] = FALSE;
          $form['name']['#required'] = FALSE;
        }
      }
    }
  }
}