[TYPO3-english] TScript Condition NOT operator?
Benoit Montereau
bmontereau at gmail.com
Fri Apr 15 10:21:21 CEST 2011
Hi Martin,
When you said: I pasted this function at the end of typo3conf/localconf.php.
Is it realy the solution? I was told "personnal" changes done in this file
are deleted/crashed by any update done by Typo3 itself. Is that right?
Cheers,
Ben
On Fri, Apr 15, 2011 at 10:14 AM, Martin Mädler <
martin.maedler at rwth-aachen.de> wrote:
> Am 14.04.2011 09:08, schrieb Martin Mädler:
>
>> Hello,
>>
>> I haven't seen this documented anywhere, but I ran into a problem where I
>> need a NOT operator in one of my conditions. Since it is not possible to
>> nest conditions, I broke mine up into 3 seperate conditions. The logic
>> should work like this:
>>
>> [loginUser = 1] # if user 1 is logged in (IP not relevant)
>> temp.submenu.excludeUidList = 118
>> [IP = 12.345] && [loginUser = !1] # if IP starts with 12.345 and no user
>> is logged in
>> temp.submenu.excludeUidList = 97
>> [else] # IP doesn't match and not logged in (there is only one fe-user)
>> temp.submenu.excludeUidList = 97, 118
>> [global]
>>
> Hello, I could solve the problem with the aid of a "userFunc" (see code
> below).
> Moreover, it is possible to check if no user is logged in with this syntax
> [loginUser = ]. It is just not documented ;)
>
> [loginUser = 1]
> temp.submenu.excludeUidList = 118
> [IP = 12.345] && [loginUser = ]
> temp.submenu.excludeUidList = 97
> [loginUser = ] && [userFunc = user_notIP(12.345)]
> temp.submenu.excludeUidList = 97, 118
> [global]
>
> function user_notIP($value) {
> if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $value)) {
> return FALSE;
> }
> // else
> return TRUE;
> }
>
> I pasted this function at the end of typo3conf/localconf.php.
>
> Best Regards
> Martin
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>
More information about the TYPO3-english
mailing list