AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones LDAP
  • Adding a new object into an LDAP server
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Adds an attribute or adds a new value to an existing attribute.
This function can be used when creating a new object and when modifying an object in an LDAP server.
Ejemplo
// Add a Test user into an "Active Directory"
LDAPStartAdd("MyLDAPSession")
LDAPAddAttribute("MyLDAPSession", "objectClass", "top")
LDAPAddAttribute("MyLDAPSession", "objectClass", "person")
LDAPAddAttribute("MyLDAPSession", "objectClass", "organizationalPerson")
LDAPAddAttribute("MyLDAPSession", "objectClass", "user")
LDAPAddAttribute("MyLDAPSession", "objectCategory", ...
	"CN=Person,CN=Schema,CN=Configuration,DC=company,DC=fr")
LDAPAddAttribute("MyLDAPSession", "instanceType", "4")
LDAPAddAttribute("MyLDAPSession", "cn", "Test")
LDAPAddAttribute("MyLDAPSession", "sAMAccountName", "Test")
LDAPValidateAdd("MyLDAPSession", "cn=Test,cn=Users,dc=company,dc=us")
// Adds a value to an attribute. The attribute is created if it does not exist. 
// The value is added to the existing values for this attribute
// The new value is found in sNewValue
LDAPStartModify("SessionName")
LDAPAddAttribute("SessionName", "AttributeName", sNewValue)
LDAPValidateModify("SessionName", "DN")
Sintaxis
<Result> = LDAPAddAttribute(<LDAP session> , <Attribute name> , <Attribute value>)
<Result>: Boolean
  • True if the addition was performed,
  • False otherwise. ErrorInfo returns more details about the error.
The actual addition will be performed during the call to LDAPValidateAdd or to LDAPValidateModify.
<LDAP session>: Character string
Name of LDAP session used.
<Attribute name>: Character string
Name of the attribute to add. This attribute is automatically added if it does not exist.
<Attribute value>: ANSI character string
Value of the added attribute or new value of the attribute.
Note For some attributes (defined by the LDAP server schema), it is possible to have several values for the same attribute. The new value will be added if a value already exists for this attribute.
Observaciones

Adding a new object into an LDAP server

To add a new object into an LDAP server, you must define the different attributes of this object as well as their values.
To optimize object creation speed, attributes and their values are defined locally: a single communication with the server is established during validation of the addition. The steps are:
  1. Initialize the addition (LDAPStartAdd)
  2. Add attributes and their values (LDAPAddAttribute). This operation can be performed as many times as necessary.
  3. Associate the attributes and their values with an object using LDAPValidateAdd.
Caution:
  • These operations being performed locally then on the server, the logical order of the modifications must be respected (you cannot for example modify an attribute that was already deleted by the previous line of code).
  • To add an attribute on a "user" of the Active Directory, the attribute must have been declared beforehand in the parameters of the Active Directory as an attribute that can be exploited in the LDAP database.
Componente: wd300com.dll
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local