[Typo3-dev] Making a better access control using XCLASS

tapio tapio.markula at dnainternet.net
Thu Aug 25 18:14:48 CEST 2005


>> Four your own site a solution is to use ux_ux_CLASSNAME. But I don't 
>> suggest this for a published extension.

What Masi proposed has some ideas, but it does have problems.

'class ux_ux_SC_alt_doc extends ux_SC_alt_doc extends' needs that the 
extension, which is used in the 'extends' statement (in this case 
'ux_SC_alt_doc' needs for example this statement on the bottom:

// Include extension?
if (defined('TYPO3_MODE') && 
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3conf/ext/tm_contentaccess/class.ux_sc_alt_doc_tm.php']) 
{ 
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3conf/ext/tm_contentaccess/class.ux_sc_alt_doc_tm.php']);
}

and the extension, which use that needs corresponding statement, in this 
case
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3conf/ext/tm_contentaccess/class.ux_sc_alt_doc_tm.php'] 
= t3lib_extMgm::extPath($_EXTKEY) . 'class.ux_sc_alt_doc.php';

That would not in certain situation be a problem, if dependencies are 
known and certain plugins require some other plugins, which extens the 
original 'SC_alt_doc' class.

The problem is that everything should go in correct order.

File, which has 'extends ux_SC_alt_doc' must be loaded *after*
the file which has 'extends SC_alt_doc'.

In my case Typo3 reads 'tm_contentaccess' *before* 'erotea_date2cal'
even if in the 'localconf.php' in '$TYPO3_CONF_VARS['EXT']['extList']'
*after* 'tm_contentaccess'. At least the extension list can't control this.

The order should be *opposite* because 'erotea_date2cal' is (presumably) 
quite common used plugin.

I try to set a new dependy ('tm_contentaccess' requires 
'erotea_date2cal'), but it has no effect. If the order can't be 
controlled, it is not possible to use nested extends statements in 
public extensions. It seems to be true that 'ux_ux_CLASSNAME' simple 
doesn't work in public extensions.

Even if you could control loading orders you can't know all possible 
extensions, which might extend the original 'SC_alt_doc' class. You 
might be able to chain in your local installation some plugins because 
you know in which order they are loaded.





More information about the TYPO3-dev mailing list