You are here

function _ldaphelp_get_configuration in LDAP integration 6

Get config information for general config and each ldap server defined.

Parameters

boolean $admin_settings:

array $sids Array of server ids to look up, NULL means all.:

1 call to _ldaphelp_get_configuration()
ldaphelp_status in ldaphelp/ldaphelp_status.inc

File

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

Code

function _ldaphelp_get_configuration($admin_settings = TRUE, $sids = NULL) {
  if ($admin_settings) {
    $form = ldapauth_admin_settings();
    $data['admin_settings'] = _ldaphelp_get_form_values($form);
  }
  $data['ldaps'] = array();

  //TODO: This won't work with an array of sids!!!!
  if (!(is_array($sids) && count($sids) == 0)) {
    if ($sids == NULL) {
      $result = db_query("SELECT sid FROM {ldapauth} ORDER BY name");
      while ($row = db_fetch_object($result)) {
        $sids[] = $row->sid;
      }
    }
    if (count($sids) > 0) {
      foreach ($sids as $sid) {
        $form = ldapauth_admin_form($form_state, 'edit', $sid);
        $data['ldaps'][$sid] = _ldaphelp_get_form_values($form);
        unset($data['ldaps'][$sid]['bindpw_clear']);
      }
    }
  }
  return $data;
}