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.

Form Questions /

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

Question about LoginForm


Go to End


4 Posts   1473 Views

Avatar
_Vince

Community Member, 165 Posts

22 April 2010 at 1:00am

I have a group of users that should just be allowed to view some password protected pages.

They're not supposed to access the CMS itself in any way.

I have put these users in a group with no rights and I have set the hidden pages' access stuff in the CMS to say that only Admins and that group can view those pages, and only Admins can edit the pages.

I've created a Page class with a $LoginForm in the template.

But when I use the $LoginForm to log in as one of those users, the form tries to open the CMS, the form says that the user can't access this part of the CMS and the hidden pages aren't displayed either.

I know the user has logged in because the message is in Catalan, an interface language I chose arbitrarily for them

What I would like to know is:

how do I have those users log in and be either redirected to the site's home page (or some page on the site) without trying to open the CMS and

what am I doing wrong with the access rights for the pages. I thought an F5 would display the hidden pages but they don't get displayed at all.

Avatar
_Vince

Community Member, 165 Posts

22 April 2010 at 6:55pm

Anybody..?

Avatar
dhensby

Community Member, 253 Posts

23 April 2010 at 8:54pm

It appears that your loginform seems to be sending the user to /admin

If you use the CMS to assign access rights to specific pages, there shouldnt be any need for you to write your own loginform into the page. SS will automatically handle the authentication for you.

Avatar
_Vince

Community Member, 165 Posts

8 May 2010 at 9:06pm

Well, yeah, you'd think so, but the LoginForm seems to always attempt to let people into the CMS once they've logged in.

In the end, I found a recipe for a custom login form and wrote something like it, redirecting people to different pages depening on their user group.

Thanks for the reply, though. (: