[TYPO3] php help in regards to frontend logins
dave typo
typothree at gmail.com
Wed May 9 17:31:06 CEST 2007
hmm can't seem to see the key when typing in
t3lib_div::debug($logged);
just says debug at the upper left hand corner with no array displayed.
this is my code currently:
$usergroups = explode(',', $logged['usergroups']);
t3lib_div::debug($logged);
if (in_array($8, usergroups)) {
$this->markContentArray["###DOWNLOAD_LINK###"] = '';
if($this->conf['addDownloadLink']) {
$this->markContentArray["###DOWNLOAD_LINK###"] = '<a
href="' . $info['origFile'] . '"' .
$target.$GLOBALS['TSFE']->ATagParams .
'>download original image</a>';
}
}
this does not parse the ###DOWNLOAD_LINK### in the front end either,
and its displayed as ###DOWNLOAD_LINK### (exactly as it is written)
any more help? ;)
thanks
-dave
On 5/9/07, Mauro Lorenzutti <mauro.lorenzutti at webformat.com> wrote:
>
> > 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
> ---------------------------------------------------------
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>
More information about the TYPO3-english
mailing list