Name
ldap_modify — Modifies an existing LDAP directory.
Synopsis
int
ldap_modify
(
|
in server_url varchar , |
in try_tls integer , | |
in data varchar , | |
in username varchar , | |
in
password
varchar
) ; |
Description
This function modifies an existing LDAP directory entry.
Parameters
server_url
The server URL has three parts, <protocol>://<host>:<port>. Missing parameters will be defaulted to:
<ldap://localhost:389>
.
try_tls
try_tls
is a flag that tells the client to perform a handshake
with the LDAP server using a secure connection. This is only applicable to the
ldap:// protocol and not ldaps://.
data
data
is an array with name/value pairs
representing the data of the modified entry.
username
username authorization credential
password
password authorization credential
Return Types
The error status code is returned.
This function will return zero on success or non-zero in case of a failure. In case of a failure the signal will be raised according to SQL error codes and Virtuoso internal error codes.
The reserved prefix for internal errors is 'LD'.
Errors
Table 24.49. Errors signalled by
ldap_modify
SQLState | Error Code | Error Text | Description |
---|---|---|---|
2E000 | LD005 | Failed to initialize LDAP connection: <reason> (<reason code>) | |
2E000 | LD006 | Failed to set LDAP version option: <reason> (<reason code>) | |
2E000 | LD016 | Failed to start TLS: <reason> (<reason code>) | |
28000 | LD007 | Failed to bind synchronous LDAP connection: <reason> (<reason code>) | |
2E000 | LD004 | The DN must be supplied | |
2E000 | LD004 | Failed to modify err=<reason code (<reason>) |
Examples
Example 24.204. Using ldap_modify
create procedure sam_ldap_modify (in s1 varchar, in s2 varchar) { declare res, vec any; declare _from_modify integer; vec := vector ('dn', concat ('cn=', s1, ' ', s2, ',o=opl,c=BG'), 'mail', vector('new_mail@techno-link.com'), 'telephoneNumber', vector('123-45-00', '032-633710', '048 850 760') ); _from_modify := ldap_modify ('ldap://localhost:389', 0, vec, NULL); return (_from_modify); };