You are here

function ldap_authorizations_admin_index in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_authorization/ldap_authorization.admin.inc \ldap_authorizations_admin_index()
  2. 7.2 ldap_authorization/ldap_authorization.admin.inc \ldap_authorizations_admin_index()

index of ldap authorization configurations

Return value

string html table

1 string reference to 'ldap_authorizations_admin_index'
ldap_authorization_menu in ldap_authorization/ldap_authorization.module
Implements hook_menu().

File

ldap_authorization/ldap_authorization.admin.inc, line 16
Administrative page callbacks for the ldap_authorization module. Consumer configuration form and index.

Code

function ldap_authorizations_admin_index() {
  $consumers = ldap_authorization_get_consumers(NULL, TRUE, FALSE);
  if (!is_array($consumers) || count($consumers) == 0) {
    drupal_set_message(t('No authorization consumer modules are enabled.  Enable
    LDAP Authorization Drupal Roles, OG LDAP, or another LDAP Authorization consuming module'), 'warning');
  }
  $servers = ldap_servers_get_servers(NULL, 'enabled');
  if (count($servers) == 0) {
    return t('ldap authorization can not be set up until ldap servers are configured.') . '  ' . l(t('Add LDAP Server'), 'admin/config/people/ldap/servers/add');
  }
  foreach ($consumers as $consumer_type => $consumer) {
    $consumers[$consumer_type] = ldap_authorization_get_consumer_object($consumer_type);
  }
  return theme('ldap_authorization_admin_index', array(
    'consumers' => $consumers,
  ));
}