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.

Forum Module

Discuss the Forum Module.

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

User Accounts


Reply

3 Posts   1470 Views

Avatar
animasola

20 December 2009 at 7:45pm Community Member, 121 Posts

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

20 December 2009 at 7:57pm Community Member, 121 Posts

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

20 December 2009 at 8:19pm Forum Moderator, 5511 Posts

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.