[TYPO3] php help in regards to frontend logins

Mauro Lorenzutti mauro.lorenzutti at webformat.com
Wed May 9 15:10:27 CEST 2007


> if ($logged = $GLOBALS["TSFE"]->fe_user->user  == 8) {
>  $this->markContentArray["###DOWNLOAD_LINK###"] = '';

>            if($this->conf['addDownloadLink']) {

>                $this->markContentArray["###DOWNLOAD_LINK###"] = '<a
> href="' . $info['origFile'] . '"' .
>                        $target.$GLOBALS['TSFE']->ATagParams .
'>>download original image</a>';
>                }
>            }


> // also is  8 on the first line also be the uid of the user group?



I think you have to write something like this:

$logged = $GLOBALS["TSFE"]->fe_user->user;

if ($logged['group'] == 8)                {
   ...
}

I don't remember if 'group' is the correct key, you can see the whole
array by adding this line:

t3lib_div::debug($logged);

And then you'll be sure about the correct key.

Pay attention to the fact that a user can belong to more than one
usergroup. For this reason your test can't be "==" but you have to use
something like this:

$usergroups = explode(',', $logged['group']);
if (in_array(8, $usergroups)) {
  ...
}

Regards,
 Mauro Lorenzutti


e-mail:  mauro.lorenzutti at webformat.com

---------------------------------------------------------
WEBFORMAT srl | Corte Europa, 12 | I-33097 SPILIMBERGO PN
     Tel +39-0427-926.389  --  Fax +39-0427-927.653
       info at webformat.com  --  http://www.webformat.com
---------------------------------------------------------


More information about the TYPO3-english mailing list