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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Frontend user managment


Reply


6 Posts   2372 Views

Avatar
Bambii7

Community Member, 254 Posts

5 March 2009 at 2:03pm

Hi Silverstripe!
Mmmmmmmmm I'm loving it.

Any way I've been using Joomla for the last few years, and slowly but surely converting to the amazing home grown CMS. Being noob I'm having trouble finding info on controlling access to published pages. I've almost finished a site for the Takapuna Business Association, but need to get a front end login form happening, this form is only for the members of the association where they can keep records of meetings and other very very fascinating stuff. Can someone point me in the right direction on some documentation? I've read a few posts in the archive but most of them didn't have any links to documentation. I really have been trying to find info, honest. Help or pointers would be much appreciated.

Avatar
Willr

Forum Moderator, 5513 Posts

5 March 2009 at 4:28pm

You can manage frontend user management within the 'Access' tab in the content editor window in the CMS. In this tab you can set who can view the page.

It will then prompt users to enter a username / password to view that page and it will also check they have permission to view that page. You can manage the users / groups in the Security section of the CMS.

Avatar
Bambii7

Community Member, 254 Posts

5 March 2009 at 5:25pm

Cheers for the reply Willr, I shall have a play with that.
I was hoping for a solution to hide the menu items from users who weren't logged in. But I should be able to manipulate it some how if it doesn't do it already. I'm just used to Joomla's user groups. Although I like Joomla, SS is so much easier to use and understand with the backend interface. Clients are also less intimidated by it, + it's a little late to be switching.

You wouldn't by chance know where some info is on this, maybe in the wiki? I've failed to find what I was after.

Avatar
Willr

Forum Moderator, 5513 Posts

5 March 2009 at 5:34pm

Im pretty sure this is a feature out of the Box, I thought it did it automatically but since it doesn't I believe you can call canView on the page so in your menu code you probably have something like

<% control Menu(1) %>
<a href="$Link">$MenuTitle</a>
<% end_control %>

Try using canView which should return true, false based on if the user can view the page.

<% control Menu(1) %>
<% if canView %>
<a href="$Link">$MenuTitle</a>
<% end_if %>
<% end_control %>

Avatar
Bambii7

Community Member, 254 Posts

6 March 2009 at 11:26am

YUS!!
You're right willr.

<% if CurrentMember %>

<h3>Hi $CurrentMember.FirstName <a href="/Security/logout">(logout?)</a></h3>

<% else %>

<form action="Security/?executeForm=LoginForm" method="post" enctype="application/x-www-form-urlencoded">
<input class="hidden" type="hidden" name="AuthenticationMethod" value="MemberAuthenticator" />
<p>email:</p>
<input class="text" type="text" name="Email" value="" />
<p>password:</p>
<input class="text" type="password" name="Password" value="" />
<input class="hidden" type="hidden" name="BackURL" value="/$URLSegment" />
<input class="action" type="submit" name="action_dologin" value="Log in" />
</form>

<% end_if %>

And using $URLSegment as the return URL gives a login for that can site on the bottom of every page.

Thanks a bunch for help, I was struggling.

Avatar
Bureau Berg

Community Member, 7 Posts

3 December 2011 at 1:16am

Hello there,

I am trying with same HTML "Login Form" you have mentioned above. But when I press on login button it is giving me blank page. And URL go to http://domain.com/Security/?executeForm=LoginForm.

Please guide me.

Thanks,
Kumar Sekhar