function ldap_server_token_replace in Lightweight Directory Access Protocol (LDAP) 7
Parameters
array $ldap_entry:
string $text:
Return value
string text with tokens replaced
2 calls to ldap_server_token_replace()
- LdapServer::deriveEmailFromEntry in ldap_servers/
LdapServer.class.php - ldap_profile_user_login in ldap_profile/
ldap_profile.module - Implements hook_user_login().
File
- ldap_servers/
ldap_servers.functions.inc, line 151 - collection of functions that don't belong in server object
Code
function ldap_server_token_replace($ldap_entry, $text) {
$desired_tokens = ldap_server_tokens_needed_for_template($text);
$tokens = ldap_server_tokenize_entry($ldap_entry, $desired_tokens, LDAP_SERVERS_TOKEN_PRE, LDAP_SERVERS_TOKEN_POST);
$result = str_replace(array_keys($tokens), array_values($tokens), $text);
return $result;
}