Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Forum Module /

Discuss the Forum Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

User Accounts


Go to End


3 Posts   2146 Views

Avatar
animasola

Community Member, 121 Posts

20 December 2009 at 7:45pm

Hi,

I basically have three questions:

1) Is it safe to use the member registration and authentication of the forum module for the rest of my site? I just don't want to use it to authenticate my users to use the forum but for other site features as well. So that I don't need another module for authentication and to make it more integrated.

2) If the answer to question 1 is yes, how can I also check whether or not the user is logged in or not? Because here is what I want: I want it to be the first thing my users see when they visit the site, a login form or when they are logged in, it says welcome "username".

3) How can I grab the sessions for that? So that I can handle the access to other site features as well.

Thanks! :)

Avatar
animasola

Community Member, 121 Posts

20 December 2009 at 7:57pm

Or better yet, after browsing the forums and a couple of sites, would it be better to create my own user registration and then use the authentication to verify whether or not my users can view the forums?

Avatar
Willr

Forum Moderator, 5523 Posts

20 December 2009 at 8:19pm

It'll be fine to use the forum sign in for other parts. Member sign in is a global SS feature so if you sign in to the forum that member is logged in for the rest of the site.

If you want to check a member is logged in you can check in the template using <% if CurrentMember %>Hi $CurrentMember.FirstName<% end_if %>. Or if you need to check for the member in your PHP code you can do Member::currentUser(); which returns a member object if they are logged in or null / false if they aren't logged in.