You are here

function shib_auth_form_alter in Shibboleth Authentication 7.4

Same name and namespace in other branches
  1. 8 shib_auth.module \shib_auth_form_alter()
  2. 5.3 shib_auth.module \shib_auth_form_alter()
  3. 5.2 shib_auth.module \shib_auth_form_alter()
  4. 6.4 shib_auth.module \shib_auth_form_alter()
  5. 6 shib_auth.module \shib_auth_form_alter()
  6. 6.2 shib_auth.module \shib_auth_form_alter()
  7. 6.3 shib_auth.module \shib_auth_form_alter()

Alters user_login form for the shibboleth authentication module.

Parameters

array $form: The form array.

array $form_state: Contains all of the data of the form.

string $form_id: The form ID.

File

./shib_auth.module, line 1211
Drupal Shibboleth authentication module.

Code

function shib_auth_form_alter(array &$form, array &$form_state, $form_id) {
  global $user;
  if ($form_id == 'user_login') {
    $form['shibboleth'] = array(
      '#type' => 'markup',
      '#weight' => -20,
      '#markup' => _login_url_html(),
    );
  }
  if ($form_id == 'user_profile_form' && $form['#user']->uid == $user->uid) {
    $form['shibboleth'] = array(
      '#weight' => -1,
      '#markup' => _login_url_html(TRUE),
    );
  }
  if ($form_id == 'user_admin_role') {
    shib_auth_generate_rolenames(TRUE);
  }
}