Logout old user ... Login new user


Author
Message
Charles Thomas Blankenship...
Charles Thomas Blankenship
StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)
Group: Awaiting Activation
Posts: 172, Visits: 12K
I've read the thread concerning this but it didn't quite sink in.

All I need to do is that after I call SessionLoc.LockSession() and my custom login form appears:

1. I need the previously logged in user to be logged out
2. The exit button enabled
3. If a new login occurs, log in the new user.

Currently, when the next user attempts to login, regardless of credentials, if the credentials are met then the application becomes active again ... with the old user still logged in.  I see the value in this assuming a user simply wants to lock their application and then return to it later.  But I want the whole login process to occur again and the Security object to reflect the newly logged in user.

Should be easy I just don't know how to make it happen.

Thanks,

Charles T. Blankenship
Senior Consultant
Novant Consulting, Inc.
704.975.7152
http://www.novantconsulting.com
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Charles.

I cannot reproduce the fact that a new user will log in and the session will be still running under the old user credentials after that. Whenever a different user logs in after a Session Lock, this user will be the current user from then on. If the old user left a form open which the new user has no permission to see it, right after the new login that form will automatically receive a panel to cover all its controls and the new logged in user won't have access to it. 

Now, if you, for example, like I do in my application, have menu items that should be Enabled/Disabled depending on the current user permissions, you will have to refresh those statuses by yourself. In my situation, I have added a handler for the AfterSessionLock into my MainForm, like this:

        '-- Add handler to refresh Menus after Session Lock         
        AddHandler MicroFour.StrataFrame.Security.SessionLock.AfterSessionLock, AddressOf HandleAfterSessionLock


This way, I can then add any code needed to refresh the new situation:

    Public Sub HandleAfterSessionLock(ByVal sender As ObjectByVal e As EventArgs)        
       '-- add code to deal with new user logged in
    End Sub


Hope it helps.

Ivan




Edited 8 Years Ago by Ivan George Borges
Edhy Rijo
E
StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)StrataFrame VIP (3.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi All,
I do the same as Ivan.
If in any case you may have your own table to show users currently logged into the application, then you will have to update your table yourself in the same process.

AFAIK, StrataFrame does not keep any record of the previous logged user.

Edhy Rijo

Charles Thomas Blankenship...
Charles Thomas Blankenship
StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)StrataFrame User (350 reputation)
Group: Awaiting Activation
Posts: 172, Visits: 12K
Thanks a bunch guys ... I'll keep you posted as to the outcome.

Charles T. Blankenship
Senior Consultant
Novant Consulting, Inc.
704.975.7152
http://www.novantconsulting.com
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search