function ldap_help_get_ldap_authorization in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_help/ldap_help.status.inc \ldap_help_get_ldap_authorization()
- 7.2 ldap_help/ldap_help.status.inc \ldap_help_get_ldap_authorization()
1 call to ldap_help_get_ldap_authorization()
- ldap_help_status in ldap_help/
ldap_help.status.inc - @file status file for ldaphelp module
File
- ldap_help/
ldap_help.status.inc, line 345 - status file for ldaphelp module
Code
function ldap_help_get_ldap_authorization() {
$status = array();
ldap_server_module_load_include('php', 'ldap_authorization', 'LdapAuthorizationConsumerConfAdmin.class');
ldap_server_module_load_include('inc', 'ldap_servers', 'ldap_servers.settings');
ldap_server_module_load_include('inc', 'ldap_servers', 'ldap_servers.admin');
$servers = ldap_servers_get_servers(NULL, 'enabled');
$consumers = ldap_authorization_get_consumers();
if (count($servers) == 0) {
return array();
}
foreach ($servers as $sid => $server) {
$server_options[$sid] = $server->name;
}
$items['status']['mapping_id'] = 'string';
$items['status']['consumer_type'] = 'string';
$items['status']['status'] = 'string';
$items['status']['only_ldap_authenticated'] = 'string';
$items['derive_from_dn']['derive_from_dn'] = 'string';
$items['derive_from_dn']['derive_from_dn_attr'] = 'string';
$items['derive_from_attr']['derive_from_attr'] = 'string';
$items['derive_from_attr ']['derive_from_attr_attr'] = 'string';
$items['derive_from_attr']['derive_from_attr_use_first_attr'] = 'checkbox';
$items['derive_from_entry']['derive_from_entry'] = 'string';
$items['derive_from_entry']['derive_from_entry_entries'] = 'string';
$items['derive_from_entry']['derive_from_entry_attr'] = 'string';
$items['derive_from_entry']['derive_from_entry_user_ldap_attr'] = 'string';
$items['derive_from_entry']['derive_from_entry_nested'] = 'checkbox';
$items['derive_from_entry']['derive_from_entry_use_first_attr'] = 'checkbox';
// $items['filter_and_mappings']['mappings'] = 'string';
$items['use_filter']['mappings'] = 'string';
$items['misc_settings']['allow_synch_both_directions'] = 'string';
$items['misc_settings']['synchronization_modes'] = 'string';
$items['misc_settings']['synchronization_actions'] = 'string';
foreach ($consumers as $consumer_type => $consumer) {
$consumer_obj = ldap_authorization_get_consumer_object($consumer_type);
$mapping_admin = new LdapAuthorizationConsumerConfAdmin($consumer_obj, FALSE);
$authorization_form = $mapping_admin
->drupalForm($server_options, 'edit');
$status[$consumer_type] = ldap_help_parse_form($authorization_form, $items);
$maps = $authorization_form['filter_and_mappings']['mappings']['#default_value'];
$map_content = trim($maps) ? "mappings present" : "empty";
if ($map_content == 'data present') {
$map_content .= $maps == drupal_strtolower($maps) ? ', lower case' : ', mixed case';
}
$status[$consumer_type][] = array(
'title' => 'mappings',
'value' => $map_content,
);
}
return $status;
}