[Typo3-dev] Making a better access control
Dmitry Dulepov
typo3 at fm-world.ru
Tue Aug 23 15:01:03 CEST 2005
Hi!
tapio wrote:
> I tried first $BE_USER['user']['admin'], which is the format of the
> array, when classes have not been used.
Search in the source code for Typo3 revealed to me that $BE_USER is not
an array...
> But when classes has been used, it must be $BE_USER->user[admin];
This is wrong from PHP point of view and may cause E_NOTICEs like "usage
of undefined constant `admin`". Undefined constants implicitly converted
to strings but this is a bad practice and not portable. I know one web
host where it does not work (hit about it hardly once when mistyped
constant definition).
Another quick search through Typo3 source code gave me a number of
entries that looked like:
$BE_USER->user['admin']
or
$BE_USER->user["admin"]
This is how you should write.
Dmitry.
More information about the TYPO3-dev
mailing list