How to know is logged in?


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

How could I know if user has logged in system in Web environment?



Thank you
Replies
Dustin Taylor
Dustin Taylor
StrataFrame Team Member (938 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
This is described in the help docs. As the snippet that Ivan posted points out, you use the SecurityBasics.CurrentUser property to get the currently logged in user. When operating in a web environment, you will need to make a configuration change so that the CurrentUser property will function correctly.  This configuration change is outlined in the Required Global.asax Code topic.

The pertinent instructions from that help topic are pasted below:

IsWebEnvironment

The MicroFour.StrataFrame.Security.SecurityBasics class contains the shared (static) property IsWebEnvironment.  This property is used to indicate to the security module that the security is being run from within a web application and that the session objects should be used to store the CurrentUser and other session specific data. The IsWebEnvironment property should be set at the top of the Application_Start() method within the Global.asax file.

Sample - Setting the IsWebEnvironment Property [Visual Basic]
Imports MicroFour.StrataFrame.Security
...
Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    '-- Set the property
    SecurityBasics.IsWebEnvironment = True
End Sub


 

Sample - Setting the IsWebEnvironment Property [C#]
using MicroFour.StrataFrame.Security;
...
protected void Application_Start(object sender, EventArgs e)
{
    //-- Set the property
    SecurityBasics.IsWebEnvironment = true;
}

Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Yeah. I have set SecurityBasics.IsWebEnvironment = True. However, I still don't know how to determine whether user has already log in to system or he/she just try to access page via direct url.
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

May I know how to do it?

I still unable to figure out.



Thank you
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