AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Neue Attribute mit LDAP hinzufügen

Ein Thema von RWarnecke · begonnen am 12. Aug 2007 · letzter Beitrag vom 19. Aug 2007
 
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#8

Re: Neue Attribute mit LDAP hinzufügen

  Alt 19. Aug 2007, 18:22
Hallo Rolf,

ich habe mir deinen Code mal angesehen, ein wenig umgeformt und kommentiert.

Delphi-Quellcode:
procedure TDemoForm.ButtonClick(Sender: TObject);
var
  conn: LdapConnection;
  entries: LdapEntryList;
  entry: LdapEntry;
  newEntry: LdapEntry;
begin
  conn := LdapConnection.Create;

  // quick hack to get read access in spite of protocol error
  // actually we need strong authorization to apply changes
  try conn.Open('www.openldap.com') except end;

  // create container for search results
  entries := LdapEntryList.Create;

  // execute subtree search
  conn.Search(entries, 'dc=OpenLDAP,dc=org', '(objectClass=openLDAPperson)');

  // single out second entry
  entry := entries.GetEntry(1);

  // clone entry
  newEntry := LdapEntry.Create(entry);

  // change location
  newEntry.Modify('l', 'Stuttgart');

  // issue mod request
  conn.Modify(entry, newEntry);

  // house keeping
  entry.Free;
  newEntry.Free;
  entries.Free;
  conn.Close;
  conn.Free;
end;
Grüße vom marabu
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:23 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz