Delphi ile active directory authentication yapıyorum.
Authentication işleminden sonra objelerim access violation exception hatası alıyor.
Sebebi nedir.
Debugda iken objenin üzerine gittiğimde linkdeki şekilde oluyor
http://img24.resimup.net/di/AGZ5.png
İlgili kütüphane için:
http://www.agnisoft.com/white_papers/ac ... ectory.asp
Kod: Tümünü seç
try
sonuc:= domainKontrol(trim(Edit1.Text),trim(Edit2.Text));
if sonuc=true then
islemTamam(bTemsilci)
else
showmessage('Parolanız Hatalıdır !');
except on E: Exception do
showmessage('Parolanız Hatalıdır !');
end;
Kod: Tümünü seç
function TLoginFrm.domainKontrol(domainUser:string;domainPass:string):Boolean;
var
dom:IADsContainer;
usr:IADSUser;
begin
try
if dom<>nil then dom:=nil;
ADsOpenObject('WinNT://localdomain.local',domainUser,domainPass,ADS_SECURE_AUTHENTICATION,IADsContainer,dom);
ADsOpenObject('WinNT://localdomain.local/'+domainUser,domainUser,domainPass,ADS_SECURE_AUTHENTICATION,IADsUser,usr);
if (usr.AccountDisabled) or (usr.IsAccountLocked) then
begin
KullaniciBloke.Close;
KullaniciBloke.ParamByName('domain_username').Value:=domainUser;
KullaniciBloke.ExecSQL;
KullaniciBloke.Close;
Result:=false
end
else
Result:=true;
except on E: Exception do
Result:=false;
end;
end;