![]() |
|
||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|||||
|
|
||||||
| Other Library Functions | ||||||
| function |
ldap.create-attribute |
|
Library: Interfaces, LDAP support (OMLDAP)
Import: omldap.xmd |
define external ldap.attribute function ldap.create-attribute
named value stream attribute-name
of-type value integer datatype optional
with-values read-only stream values
or
define external ldap.attribute function ldap.create-attribute
named value stream attribute-name
of-type value integer datatype optional
with-value remainder stream value
and ...
Argument definitions
This function assigns value(s) to an ldap.attribute of an entry that you will add later with the ldap.add-entry function.
This example creates two attributes. The attribute "cn" (common name) contains multiple text values. The attribute "photo" contains a single binary value (the contents of a JPEG file).
import "omldap.xmd" prefixed by ldap.
process
local ldap.connection my-ldap
local ldap.attribute my-entry variable
set my-ldap to ldap.open 'www.stilo.com'
set new my-entry to ldap.create-attribute named "cn"
with-value "Brown" and "V. Brown" and "Valerie Brown"
set new my-entry to ldap.create-attribute named "photo"
of-type ldap.binary-type
with-value file "vbrown.jpg"
ldap.add-entry my-ldap
named "cn=Brown,Department=hr,o=OmniMark.com"
attributes my-entry
In the example above, the attribute is "cn" and its three values are "Brown", " V. Brown" and "Valerie Brown".