Just to clarify, I've added that code directly into /system/config/dcaconfig.php -- as that's what the Developer's Guide recommends.
Inside dcaconfig.php, $this->User returns a valid BackendUser object (it's way too long to post). So I don't think I need to import anything here. I do see a protected variable, 'admin', which is set to "1/true".
Trying to var_dump $this->User->isAdmin in this file gets me a content encoding error, so I can't see directly what it is set to.
However, if I save it --
Code:
$GLOBALS['YOURMOM'] = $this->User->isAdmin;
And spit it out it in my be_main.tpl file --
Code:
echo( $GLOBALS['YOURMOM'] );
It shows blank/false, which it shouldn't, since I'm definitely logged in as an admin.
However, if I just put this into my be_main.tpl file --
Code:
$this->import('BackendUser', 'User');
echo($this->User->isAdmin);
It DOES return 1/true.
Bookmarks