[TYPO3] Restrict site/page loading based on HTTP_REFERER

Darko Jr. Gonzalez jkokino at gmail.com
Sat Nov 3 14:27:16 CET 2007


Hey again

On 11/3/07, Darko Jr. Gonzalez <jkokino at gmail.com> wrote:
>
> Heya
>
> > I can use condition like this in TS setup:
> > > [globalString = IENV:REMOTE_ADDR = 192.168.*]
> > > all the site content and configuration here
> > > [global]
> >
> > Since you probably cannot check referer directly in conditions, you will
> > have to write your own function that checks it and returns true or
> > false. The function will be called in the condition. See userFunc in the
> > manual [1].
>
>
> Hmmm there is this:
>
> http://wiki.typo3.org/index.php/TSref/getText#getIndpEnv:.3Cvariable_name.3E
> http://typo3.org/fileadmin/typo3api-4.0.0/d3/d3d/classt3lib__div.html#8de3416a12d356d9b2c0bf8ef12dfdfc
>


For the record, this works:
[globalVar = TSFE:id = 36]&&[globalString = IENV:HTTP_REFERER = *TLD.com*,
IENV:HTTP_REFERER = *TLD.net*]
...
some TS code
...
[global]

Basically I am testing for two referer domains (OR condition desginated by
",") and if the page id is 36 then the code in between the globalvar and
globalString conditions is executed.

Thanks

Cheers,
Darko


More information about the TYPO3-english mailing list