module Ocamldap: sig
.. end
Direct access to LDAP function
type
conn
type
msgid
type
auth_method = [ `SIMPLE ]
type
error_code = [ `ADMINLIMIT_EXCEEDED
| `AFFECTS_MULTIPLE_DSAS
| `ALIAS_DEREF_PROBLEM
| `ALIAS_PROBLEM
| `ALREADY_EXISTS
| `AUTH_METHOD_NOT_SUPPORTED
| `AUTH_UNKNOWN
| `BUSY
| `CLIENT_LOOP
| `COMPARE_FALSE
| `COMPARE_TRUE
| `CONFIDENTIALITY_REQUIRED
| `CONNECT_ERROR
| `CONSTRAINT_VIOLATION
| `CONTROL_NOT_FOUND
| `DECODING_ERROR
| `ENCODING_ERROR
| `FILTER_ERROR
| `INAPPROPRIATE_AUTH
| `INAPPROPRIATE_MATCHING
| `INSUFFICIENT_ACCESS
| `INVALID_CREDENTIALS
| `INVALID_DN_SYNTAX
| `INVALID_SYNTAX
| `IS_LEAF
| `LOCAL_ERROR
| `LOOP_DETECT
| `MORE_RESULTS_TO_RETURN
| `NAMING_VIOLATION
| `NOT_ALLOWED_ON_NONLEAF
| `NOT_ALLOWED_ON_RDN
| `NOT_SUPPORTED
| `NO_MEMORY
| `NO_OBJECT_CLASS_MODS
| `NO_RESULTS_RETURNED
| `NO_SUCH_ATTRIBUTE
| `NO_SUCH_OBJECT
| `OBJECT_CLASS_VIOLATION
| `OPERATIONS_ERROR
| `OTHER
| `PARAM_ERROR
| `PARTIAL_RESULTS
| `PROTOCOL_ERROR
| `REFERRAL
| `REFERRAL_LIMIT_EXCEEDED
| `RESULTS_TOO_LARGE
| `SASL_BIND_IN_PROGRESS
| `SERVER_DOWN
| `SIZELIMIT_EXCEEDED
| `STRONG_AUTH_NOT_SUPPORTED
| `STRONG_AUTH_REQUIRED
| `SUCCESS
| `TIMELIMIT_EXCEEDED
| `TIMEOUT
| `TYPE_OR_VALUE_EXISTS
| `UNAVAILABLE
| `UNAVAILABLE_CRITICAL_EXTENSION
| `UNDEFINED_TYPE
| `UNWILLING_TO_PERFORM
| `USER_CANCELLED ]
type
mod_op = [ `ADD | `DELETE | `REPLACE ]
type
search_scope = [ `BASE | `ONELEVEL | `SUBTREE ]
type
attr = {
|
attr_name : string ; |
|
attr_values : string array ; |
}
type
entry = {
|
entry_dn : string ; |
|
entry_attrs : attr list ; |
}
type
modattr = mod_op * string * string list
type
result = entry list
exception LDAP_Failure of error_code
Direct access to LDAP function
val add_s : conn -> dn:string -> attr:modattr list -> unit
Adds a new entry to the ldap database.
val bind_s : ?who:string ->
?cred:string -> ?auth_method:auth_method -> conn -> unit
Binds to the ldap server with the given credential and auth_method.
val delete_s : conn -> dn:string -> unit
Deletes the entry with the given dn from the database.
val err2string : error_code -> string
Retrieves an error message for the given ldap error code.
val init : ?version:int -> ?port:int -> string -> conn
Initializes a connection to the given ldap server. The connection is
* not actually established until one of the bind functions is called.
val modify_s : conn -> dn:string -> mods:modattr list -> unit
Modifies the specified entry with the modifications supplied in 'mods'.
val modrdn_s : conn -> dn:string -> newdn:string -> unit
Renames the given entry to newdn, modrdn always deletes the old rdn.
Same as modrdn but modrdn2 optionally deletes the old rdn.
val modrdn2_s : conn -> dn:string -> newdn:string -> deleteoldrdn:bool -> unit
val print_entry : ?channel:Pervasives.out_channel -> entry -> unit
Prints the given entry in LDIF format to the specified channel.
val search_s : ?base:string ->
?scope:search_scope ->
?attrs:string list ->
?attrsonly:bool -> conn -> string -> result
Search for the given entry with the specified base node and search scope,
optionally limiting the returned attributes to those listed in 'attrs'.
val search : ?base:string ->
?scope:search_scope ->
?attrs:string list ->
?attrsonly:bool -> conn -> string -> msgid
Search for the given entry with the specified base node and search scope,
optionally limiting the returned attributes to those listed in 'attrs'.
this is the asyncronis version of search, which will return the message id
that you must then pass to get_search_entry
val get_search_entry : conn -> msgid -> entry
actually get a search entry from and async search. If no more entries
remain, will raise LDAP_Failure `SUCCESS. If an error occurs fetching an
entry, will raise LDAP_Failure e.
val simple_bind_s : ?who:string -> ?password:string -> conn -> unit
Bind using simple authentication. This is equivalent to calling bind_s
with auth_method `SIMPLE
val unbind : conn -> unit
Releases the ldap connection and frees associated resources. The ldap
connection should not be used after it has been unbound.