[Bug maybe] the IdUserManager is no useful for a real FTP Server.

Giganews Newsgroups
Subject: [Bug maybe] the IdUserManager is no useful for a real FTP Server.
Posted by:  Riceball LEE (ricebal…@Hotmail.com)
Date: Mon, 14 Mar 2005

we need apply the parameters of the user(eg, HomeDir etc) after verify
the user, but
Nothing is passed into the IdUserManager.AuthenticateUser or
ChallengeUser about this.

Suggests
  add the aContext parameter to AuthenticateUser, ChallengeUser and the
UserDisconnected.
  add a event OnLoginSuccessful(Sender: TObject; const aContext:
TObject; const aUserName: string) to IdUserManager.
  here we can apply the user parameters.

  TIdUserManagerLoginSuccessfulEvent = procedure (Sender: TObject;
    const aContext: TObject;
    const aUserName: string) of object;
TIdCustomUserManager = class
protected
  ....
  procedure DoLoginSuccessful(const aContext: TObject;
  const aUserName: string);virtual;
public
    function  ChallengeUser(var VIsSafe : Boolean;
      const aContext: TObject;
      const AUserName : String) : String; virtual;
    function  AuthenticateUser(const aContext: TObject;
      const AUsername, APassword: String): Boolean; overload;
    function  AuthenticateUser(const aContext: TObject;
      const AUsername, APassword: String;
      var VUserHandle: TIdUserHandle): TIdUserAccess; overload;

  //triggle the OnLogout event here.
  procedure UserDisconnected(const aContext: TObject;
  const AUser : String); virtual;

  property OnLoginSuccessful: TIdUserManagerLoginSuccessfulEvent
    read FOnLoginSuccessful write FOnLoginSuccessful;
  property OnLogout: TIdUserManagerLogoutEvent
    read FOnLogout write FOnLogout;
end;

btw:
  what's LogoffUser meaning? i fould it be only used in the first
AuthenticateUser overload method.
  So i decide remove it. And add a new event OnLogout.

Replies