Jump to content

sesion list


jahlxx

Recommended Posts

Hi.

 

Based in session list demo, I'm trying to build a query form for system administrator, to kow how many sessions are "live". The problem is to know who are connected.

 

I have a login form, that validates username and password to login the app. Validation is against a database.

 

Is there any property in unisession to store the username when user logs in?

 

Unisession give info about active sessions, but could be useful to know who is the user for every session.

 

I think that when a user log in the app, could be something in the unisession object to store the username.

 

For example:

 

if uservalid(xxxxxxxxxxxx) then

   unisession.someprop := username.text;

 

 

Is this possible?

 

Thanks.

Link to comment
Share on other sites

HI,

 

If I understand you correctly, you can use like this:

type
  TUniMainModule = class(TUniGUIMainModule)
  private
    { Private declarations }
  public
    { Public declarations }
    FMyStringVar : string; //<-----
  end;
 ...
    for I := 0 to S.SessionList.Count - 1  do
    begin
      U := S.SessionList[I];
      ASessionList[I].ASessionId := U.SessionId;
      ASessionList[I].AIP := U.RemoteIP;
      ASessionList[I].ALastTime := U.LastTimeStamp;
      if U.UniMainModule <> nil then // Check mainModule availability. Some sessions may not have a MainModule instance
        ASessionList[I].AMyVar := (U.UniMainModule as TUniMainModule).FMyStringVar; // Access custom MainModule props //<-------
    end;
 ...
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...