You are here

function ldaphelp_form_ldapauth_admin_form_alter in LDAP integration 6

File

ldaphelp/ldaphelp.module, line 200
The ldaphelp module is a module to help admins debug ldap_integration modules.

Code

function ldaphelp_form_ldapauth_admin_form_alter(&$form, $form_state) {
  global $_ldaphelp_ldaps;
  if (in_array(arg(4), array_keys($_ldaphelp_ldaps))) {
    $ldap_type = arg(4);
    foreach ($_ldaphelp_ldaps[$ldap_type]['fields'] as $fieldset => $pairs) {
      foreach ($pairs as $fieldname => $value) {
        $form[$fieldset][$fieldname]['#default_value'] = $value;
      }
    }
  }

  // don't hide/collapse login fieldset if data in it.
  if ($form['login-procedure']['basedn']['#default_value'] || $form['login-procedure']['user_attr']['#default_value'] || $form['login-procedure']['mail_attr']['#default_value']) {
    $form['login-procedure']['#collapsed'] = FALSE;
  }
}