[TYPO3-english] Condition to see if page has limited access

Patrick Schriner patrick.schriner at diemedialen.de
Tue Apr 9 10:25:00 CEST 2013


I have used a user function on a similar occasion:

function user_feloginFromNewsletterCheck() {
	$currentPage = $GLOBALS['TSFE']->page['uid'];
	if (t3lib_div::_GP('id') != $currentPage) {
		return TRUE;
	return FALSE;

This only works if the 404 handling is "fallback to next upper allowed  
page" - as you cannot detect a redirect.

The mad thing is that as far as I can tell there is no variable set in  
$GLOBALS['TSFE'] that would tell us which page *should* have been display  
- hence the fallback to use _$GP['id'] directly.


On Mon, 08 Apr 2013 10:25:53 +0200, Urs Bräm <info at ursbraem.ch> wrote:

> Hi Viktor
> sorry for the late reply. Thanks!
> What I had in mind was not redirecting the user to the single login  
> page, but altering the rendered page if it is protected.
> I could then display the login form on the page via ts, setting it to  
> show only if the user is not logged in, of course.
> That's why I was looking for some kind of condition that tells my TS if  
> the page has restricted access or not. Is there something like that?
> Thanks!
> Urs
> Am 19.03.13 11:09, schrieb Viktor Livakivskyi:
>> Hi.
>> You can think about making single page with login form and set globally:
>> config.typolinkLinkAccessRestrictedPages = <id_of_page_with_form>
>> also look at config.typolinkLinkAccessRestrictedPages_addParams, if you
>> want to redirect user back to non-accessible before page after his
>> successfull login.
>> Regards.
>> Hi
>>> this is probably very simple, but I couldn't look it up anyhow:
>>> Is there a condition that applies when a page (or, maybe also its
>>> content) has limited access rights AND the user doesn't have these  
>>> rights?
>>> -> to display a login form on the page - but only when needed.
>>> I know I can check with
>>> [usergroup=*]
>>> [else]
>>> (show form)
>>> [global]
>>> - but I would like to set it globally, so as soon as editors create
>>> restricted content, the login form will appear.
>>> Thanks!
>>> Urs

Patrick Schriner

More information about the TYPO3-english mailing list