unit uROLDAP; {----------------------------------------------------------------------------} { RemObjects SDK Library - Core components } { } { compiler: Delphi 6 and up, Lazarus/FPC } { platform: Win32, Linux, MacOS } { } { (c)opyright RemObjects Software. all rights reserved. } { } { Using this code requires a valid license of the RemObjects SDK } { which can be obtained at http://www.remobjects.com. } {----------------------------------------------------------------------------} {$I RemObjects.inc} interface { Note: for TLS/SSL support, you should include one from these files into your project ssl_cryptlib.pas ssl_openssl.pas ssl_sbb.pas ssl_streamsec.pas } function LDAPPlainCheck(const aUserName, aPassword, aHost: string; aPort: integer; const UseTLS: Boolean = False; const UseSSL: Boolean = False): Boolean; implementation uses SysUtils, ldapsend; function LDAPPlainCheck(const aUserName, aPassword, aHost: string; aPort: integer; const UseTLS: Boolean = False; const UseSSL: Boolean = False): boolean; var ldap: TLDAPsend; begin ldap:= TLDAPsend.Create; try ldap.TargetHost := aHost; ldap.TargetPort := IntToStr(aPort); ldap.UserName := aUserName; ldap.Password := aPassword; ldap.AutoTLS := UseTLS; ldap.FullSSL := UseSSL; Result := ldap.Login and ldap.Bind; finally ldap.Free; end; end; end.