function ldap_servers_test_user_mapping in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_servers/ldap_servers.test_form.inc \ldap_servers_test_user_mapping()
- 7.2 ldap_servers/ldap_servers.test_form.inc \ldap_servers_test_user_mapping()
1 call to ldap_servers_test_user_mapping()
- ldap_servers_test_form_submit in ldap_servers/
ldap_servers.test_form.inc - Submit hook for the LDAP server form.
File
- ldap_servers/
ldap_servers.test_form.inc, line 233
Code
function ldap_servers_test_user_mapping($drupal_username, &$ldap_server) {
$ldap_user = $ldap_server
->user_lookup($drupal_username);
$errors = FALSE;
if (!$ldap_user) {
$results[] = t('Failed to find test user %username by searching on %user_attr = %username.', array(
'%username' => $drupal_username,
'%user_attr' => $ldap_server->user_attr,
)) . ' ' . t('Error Message: ') . $ldap_server
->errorMsg('ldap');
$errors = TRUE;
}
else {
$results[] = t('Found test user %username by searching on %user_attr = %username.', array(
'%username' => $drupal_username,
'%user_attr' => $ldap_server->user_attr,
));
}
return array(
$errors,
$results,
$ldap_user,
);
}