[Typo3-dev] Follow-Up: Re: Display page in menu, regardless of login status.
Keith Morrison
keith_morrison at dfci.harvard.edu
Fri Oct 14 04:32:02 CEST 2005
Kasper,
I just wanted to follow up on this again, because I may have discovered
an issue with the implementation of this feature. I've spent a good
amount of time trying to track down why ###RETURN_URL### isn't being
populated, and the issue becomes apparent when the call "$page =
$GLOBALS['TSFE']->sys_page->getPage" is called in t3lib_page. Since
$disableGroupAccessCheck=FALSE is the default parameter setting, no
record will be returned to the function because you are trying to pull
up page information on a page that has been in some way marked for
access only when a user is logged in. Proof-of-concept: the proper
return url is created if you hack t3lib_page and pass a parameter of
TRUE to override the default. Anyway, by the time you get to this call,
the script doesn't know any longer that it should be passing that
override, because the information hasn't been passed along--and I can't
figure out a way to do it.
Note: I followed this by tracking calls, some of which passed through
realurl. From what I can determine, this would also be an issue if
someone wasn't using realurl, because it looks like getPage needs to be
called in any instance. However, the possibility exists that this is a
problem limited to realurl. I may also be missing something obvious
that would fix this.
Thanks again,
Keith
Kasper Skårhøj wrote:
> Hi Keith,
>
> If this is not already in TSref I apologize that I didn't publish it yet - will do so today maybe.
>
> For the menu objects (eg. TMENU/GMENU) you have this property to set in TypoScript, that is what I referred to 21/4 this year:
>
> <snip>
> showAccessRestrictedPages
> integer (page id) / keyword âNONEâ
> If set, pages in the menu will include pages with frontend user group access enabled. However the page is of course not accessible and therefore the URL in the menu will be linked to the page with the ID of this value. On that page you could put a login form or other message.
> If the value is âNONEâ the link will not be changed and the site will perform page-not-found handling when clicked (which can be used to capture the event and act accordingly of course).
>
> Properties:
> .addParam = Additional parameter for the URL, which can hold two markers; ###RETURN_URL### which will be substituted with the link the page would have had if it had been accessible and ###PAGE_ID### holding the page id of the page coming from (could be used to look up which fe_groups was required for access.
>
> Example:
> showAccessRestrictedPages = 22
> showAccessRestrictedPages.addParams = &return_url=###RETURN_URL###&pageId=###PAGE_ID###
>
> The example will link access restricted menu items to page id 22 with the return URL in the GET var âreturn_urlâ and the page id in the GET var âpageIdâ.
>
> </snip>
>
> k
>
> On Friday 07 October 2005 00:06, Keith Morrison wrote:
>
>>Keith Morrison wrote:
>>
>>>Hi all,
>>>
>>>I'm having the hardest time finding a solution for this. I have a lot
>>>of pages that are only viewable if you are a logged-in user; however, I
>>>want those pages to show up in my menus, regardless of whether a user is
>>>logged in or not. When the user hits the page, I want to redirect to my
>>>loginbox, and then redirect them back to the page they were on after
>>>they log in. However, I just can't figure out a way to display pages
>>>regardless of their access. I've tried TypoScript and also hacking some
>>>of the core engine code, to no avail. I feel like this is something I
>>>need to hack in the core, which is why I'm posting to the dev list. Any
>>>suggestions would be greatly appreciated.
>>>
>>>Thanks,
>>>Keith
>>
>>I apologize for responding to myself, but I did find a note in the CVS
>>log from 2005-4-21 by Kasper that seems to describe the ability to do
>>this, but I can't find any follow up information on it. The revision
>>note is on this page:
>>http://cvs.sourceforge.net/viewcvs.py/typo3/TYPO3core/ChangeLog?rev=1.258
>>
>>Thanks again,
>>Keith
>>_______________________________________________
>>Typo3-dev mailing list
>>Typo3-dev at lists.netfielders.de
>>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>
>
More information about the TYPO3-dev
mailing list