PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • LDAPSession structure
  • LDAP and user groupware
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Used to connect to an LDAP server via the characteristics defined in the LDAPSession structure. The connection is actually established during the first access (LDAPFind for example).
Example
// Check the "Login/Password" couple

// Initialization
LDAPReset()
LDAPSession.Host = "domain.local"
LDAPSession.Port = 389
LDAPSession.Version = 3
LDAPSession.User = "user@domain.local"
LDAPSession.Password = "pwd"

// Connection
LDAPConnect("MySession")

// Find information about the user.
sDn is string = LDAPFind("MySession", ...
"dc=domain,dc=local","sAMAccountName=user@domain.local")

IF sDn = "" THEN
// Unable to list the connection DN
// The login and the password do not match
Error("The password of the user " + LDAPSession.User + " is invalid.")
END

// Disconnection
LDAPDisconnect("MySession")
Syntax
<Result> = LDAPConnect(<Session Name>)
<Result>: Boolean
  • True if the connection is established,
  • False otherwise. ErrorInfo returns more details about the error.
The connection is not established if the session name already exists.
<Session Name>: Character string (with quotes)
Name of LDAP session. This name must be unique. This name will be used to identify the session in all LDAP functions.
Remarks

LDAPSession structure

The LDAPSession structure is used to specify the characteristics of LDAP session to use (server address, port, ...). This structure must be initialized before the call to LDAPConnect.
This structure is also used to specify different options such as the management mode of SSL or the connection mode.
Note: We advise you to re-initialize the LDAPSession structure via LDAPReset.

LDAP and user groupware

You project can be automatically connected to an LDAP directory via the User groupware.
Related Examples:
The LDAP functions Unit examples (WINDEV): The LDAP functions
[ + ] Using the WLanguage LDAP functions.
These functions are used to interact with the LDAP data, to view the content of any LDAP directory and to modify the LDAP data: LDAPConnect, LDAPListChildren, LDAPAdAttribute, LDAPDeleteAttributeValue, ...
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment