| Extracted from Pike v7.8 release 866 at 2016-04-05.

[Top]
Protocols
Protocols.LDAP
Protocols.LDAP.client

# Method Protocols.LDAP.client()->get_attr_type_descr()

Method get_attr_type_descr

  `mapping(string:mixed) get_attr_type_descr(string attr, void|int standard_attrs)`

Description

  Returns the attribute type description for the given attribute, which includes the name, object identifier, syntax, etc (see section 4.2 in RFC 2252 for details).

  This might do a query to the server, but results are cached.

Parameter `attr`

  The name of the attribute. Might also be the object identifier on string form.

Parameter `standard_attrs`

  Flag that controls how the known standard attributes stored in Protocols.LDAP are to be used:

  `0` | Check the known standard attributes first. If the attribute isn't found there, query the server. This is the default.
  `1` | Don't check the known standard attributes, i.e. always use the schema from the server.
  `2` | Only check the known standard attributes. The server is never contacted.

Returns

  Returns a mapping where the indices are the terms that the server has returned and the values are their values on string form (dequoted and converted from UTF-8 as appropriate). Terms without values get `1` as value in the mapping.

  The mapping might contain the following members (all except `"oid"` are optional):

  `"oid" : string` | The object identifier on string form. According to the RFC, this should always be a dotted decimal string. However some LDAP servers, e.g. iPlanet, allows registering attributes without an assigned OID. In such cases this can be some other string. In the case of iPlanet, it uses the attribute name with "-oid" appended (c.f. http://docs.sun.com/source/816-5606-10/scmacfg.htm).
  `"NAME" : string` | Array with one or more names used for the attribute.
  `"DESC" : string` | Description.
  `"OBSOLETE" : string` | Flag.
  `"SUP" : string` | Derived from this other attribute. The value is the name or oid of it. Note that the attribute description from the referenced type always is merged with the current one to make the returned description complete.
  `"EQUALITY" : string` | The value is the name or oid of a matching rule.
  `"ORDERING" : string` | The value is the name or oid of a matching rule.
  `"SUBSTR" : string` | The value is the name or oid of a matching rule.
  `"syntax_oid" : string` | The value is the oid of the syntax (RFC 2252, section 4.3.2). (This is extracted from the `"SYNTAX"` term.)
  `"syntax_len" : string` | Optional suggested minimum upper bound of the number of characters in the attribute (or bytes if the attribute is binary). (This is extracted from the `"SYNTAX"` term.)
  `"SINGLE-VALUE" : string` | Flag. Default multi-valued.
  `"COLLECTIVE" : string` | Flag. Default not collective.
  `"NO-USER-MODIFICATION" : string` | Flag. Default user modifiable.

  `"USAGE" : string`

  The value is any of the following:

  `"userApplications"` | Self-explanatory.
  `"directoryOperation"`
  `"distributedOperation"` | DSA-shared.
  `"dSAOperation"` | DSA-specific, value depends on server.

  There might be more fields for server extensions.

  Zero is returned if the server didn't provide any attribute type description for attr .

Note

  It's the schema applicable at the base DN that is queried.

Note

  LDAPv3 is assumed.