You are here

function ldap_servers_token_tokens_needed_for_template in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_servers/ldap_servers.tokens.inc \ldap_servers_token_tokens_needed_for_template()

Parameters

string $template in form [cn]@myuniversity.edu:

Return value

array of all tokens in the template such as array('cn')

3 calls to ldap_servers_token_tokens_needed_for_template()
ldap_servers_token_extract_attributes in ldap_servers/ldap_servers.tokens.inc
ldap_servers_token_replace in ldap_servers/ldap_servers.tokens.inc
ldap_user_token_replace in ldap_user/ldap_user.module

File

ldap_servers/ldap_servers.tokens.inc, line 452
collection of functions related to ldap tokens

Code

function ldap_servers_token_tokens_needed_for_template($template, $pre = LDAP_SERVERS_TOKEN_PRE, $post = LDAP_SERVERS_TOKEN_POST) {
  preg_match_all('/
    \\[             # [ - pattern start
    ([^\\[\\]]*)  # match $type not containing whitespace : [ or ]
    \\]             # ] - pattern end
    /x', $template, $matches);
  return @$matches[1];
}