21294 Posts in 5734 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1453 Views |
-
Accessing private page link for logged out users.

6 March 2009 at 1:20pm
There's this 2nd level link on one of our sites where we had a page with "access->Who can view this page?" set to "logged in users."
The link for that page used to be displayed for users that were NOT logged in, so that when they clicked on it, it would take them to the login page, then to the page that they were trying to get to.
When I upgraded to the latest stable silverstripe (from the previous stable version), the link to that page doesn't show to users that are logged out. How would I make the link show for users that are logged out so that the process would be the same as it previously was?
I know I could write in the link manually, but I need a way to do it through the cms, as people that don't know html are maintaining the site.
Thanks for any help anyone can provide.
-
Re: Accessing private page link for logged out users.

30 April 2009 at 3:34pm
I have a need to do the same thing.
I need to show the link to the page but if they are not logged in, they get a login/registration form and then they can see the content.
I'm going to subscribe to this tread in hopes we both find the answer.
Terry
-
Re: Accessing private page link for logged out users.

4 September 2009 at 10:23pm
that's a plus 1 for me too... I would also not just like the menu item but also the ability to show parts of a secure page within a holder page but have the actual page locked down and redirect to a registration form or other page if they try to access.
Any point in the right direction would be great
thanks. -
Re: Accessing private page link for logged out users.

5 September 2009 at 11:04am
What about creating a custom page function like
function GetPrivatePage(){
return DataObject::get("SiteTree", "ShowInMenus = 1 AND CanViewType = 'LoggedInUsers'");
}
That way your could render the Data from in that Page in a controlJust a thought, maybe too simple and who knows what the potential security consequences are.
-
Re: Accessing private page link for logged out users.

5 September 2009 at 12:16pm
thanks I will give that a try and post my results
-
Re: Accessing private page link for logged out users.

7 September 2009 at 11:53am
Would this function go in my ArticleHolder or ArticleHolder_Controller class?
Rendering with a control in the template would be
<% control GetPrivatePage %>
<a href="$Link" title="Read more on "{$Title}"">$Title</a>
<% end_control %>in my ArticleHolder.ss?
Am I approaching this right?
thanks in advance for your help
-
Re: Accessing private page link for logged out users.

7 September 2009 at 12:13pm
Turns out that the AllChildren method does actually work and show Children pages even if they are locked down with Security... I had my holder page behavior set wrong lol
Still a good thing to know...
| 1453 Views | ||
|
Page:
1
|
Go to Top |




