ich versuche gerade mit synapse ldapsend einen nicht erreichbaren Server abzufangen.
0815 Beispiel:
Code: Alles auswählen
procedure TForm1.Button53Click(Sender: TObject);
var
ldap: TLDAPsend;
l: TStringList;
begin
ldap:= TLDAPsend.Create;
l := TStringList.Create;
try
ldap.Version:=2;
ldap.TargetHost := 'www.openldap.com';
ldap.Username := 'cn=manager,dc=OpenLDAP,dc=org';
ldap.Password := 'pass';
ldap.Login;
ldap.Bind;
l.Add('displayname');
l.Add('description');
l.Add('givenName');
l.Add('*');
ldap.Search('dc=OpenLDAP,dc=org', False, '(objectclass=*)', l);
memo1.Lines.Add(LDAPResultdump(ldap.SearchResult));
ldap.Logout;
finally
ldap.Free;
l.Free;
end;
end;
Code: Alles auswählen
if ldap.Login then
begin
...
end;
finally
.....

Ich habe auch schon mit ein paar properties rumgespielt, bin da aber nicht vertieft und die einschlägigen suchen haben mir nicht weitergeholfen.
Ich gehe direkt auf Login ein, da hier das Programm für ca. 40 sec stehen bleibt.
Code: Alles auswählen
TLDAPSend = class(TSynaClient)
private
FSock: TTCPBlockSocket;
...
function TLDAPSend.Login: Boolean;
begin
Result := False;
if not Connect then
Exit;
Result := True;
if FAutoTLS then
Result := StartTLS;
end;
function TLDAPSend.Connect: Boolean;
begin
// Do not call this function! It is calling by LOGIN method!
FSock.CloseSocket;
FSock.LineBuffer := '';
FSeq := 0;
FSock.Bind(FIPInterface, cAnyPort);
if FSock.LastError = 0 then
FSock.Connect(FTargetHost, FTargetPort);
if FSock.LastError = 0 then
if FFullSSL then
FSock.SSLDoConnect;
Result := FSock.LastError = 0;
end;
procedure TTCPBlockSocket.Connect(IP, Port: string);
begin
if FSocksIP <> '' then
SocksDoConnect(IP, Port)
else
if FHTTPTunnelIP <> '' then
HTTPTunnelDoConnect(IP, Port)
else
inherited Connect(IP, Port);
if FLasterror = 0 then
DoAfterConnect;
end;
0
10060
Hat jemand mit der Verwendung von ldapsend Erfahrung und kann mir hier weiterhelfen?
Gerne auch rückfragen, ich habe nichts an den Quelldateien geändert.
Gruß schoschy