Jump to:

1030 Posts in 805 Topics by 311 members

Forum Module

SilverStripe Forums » Forum Module » User Accounts

Discuss the Forum Module.

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

Page: 1
Go to End
Author Topic: 1429 Views
  • animasola
    Avatar
    Community Member
    121 Posts

    User Accounts Link to this post

    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!

  • animasola
    Avatar
    Community Member
    121 Posts

    Re: User Accounts Link to this post

    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?

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: User Accounts Link to this post

    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.

    1429 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.