You are here

function ldap_servers_make_token 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_make_token()

Parameters

string $attr_name such 'field_user_lname', 'name', 'mail', 'dn':

string $attr_type such as 'field', 'property', etc. NULL for ldap attributes:

string $attr_ordinal 0, 1, 2, etc. not used in general:

Return value

string such as 'field.field_user_lname', 'samaccountname', etc.

File

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

Code

function ldap_servers_make_token($attr_name, $attr_type = NULL, $ordinal = NULL) {
  $inner_token = $attr_name;
  if ($attr_type) {
    $inner_token .= '.' . $attr_type;
  }
  if ($ordinal) {
    $inner_token .= ':' . $ordinal;
  }
  $token = LDAP_SERVERS_TOKEN_PRE . $inner_token . LDAP_SERVERS_TOKEN_POST;
  return $token;
}