[TYPO3-dev] felogin VS custom extension
Jigal van Hemert
jigal at xs4all.nl
Wed Oct 5 09:37:54 CEST 2011
Hi,
On 3-10-2011 14:59, Éric Thibault wrote:
> I have to implement an extension that presents informations on
> products . These informations could be of two types: for everyone and
> for admin users. I was wandering how to enable communications with
> the felogin (sysext) to trigger the presentation of secure
> informations as they will be mingled with normal informations inside
> the same page. I was thinking of session variables with a mixture of
> Ajax to trigger or not the presentation of sensitive information…
If you are building an extension based on Extbase/Fluid you can find the
experts in the newsgroup/mailinglist typo3.projects.typo3v4mvc
I assume that you are building an extension based on pibase (the 'old'
way ;-) ). From your description it seems that you want to present a
list of records (products) and that some of them are visible for certain
FE users and others are visible for other FE users.
If that is the case you can simply use the access fields of TYPO3. Make
sure you have the access field where you can select the FE usergroup
which has access to a record enabled in your configuration of the
products table.
In your SQL query you can simply add
$this->cObj->enableFields('tx_myproductstable'); to the where part. This
will add things like hidden='0', disabled='0' (if they are configured
for that table) and also a check for the right fe_group.
Example:
$products = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
'tx_myproductstable',
'column1=' . intval($var) .
$this->cObj->enableFields('tx_myproductstable')
);
This will automatically give the list of records which are not hidden or
deleted and visible for the fe_group(s) the currently logged in user
belongs to.
--
Kind regards / met vriendelijke groet,
Jigal van Hemert.
More information about the TYPO3-dev
mailing list