[TYPO3-dev] Performance optimization Typo3

Dmitry Dulepov dmitry at typo3.org
Tue Aug 17 13:28:10 CEST 2010


Hi!

Chris Zepernick {SwiftLizard} wrote:
> I've got no problem with the first 4 classes
> and their hierarchie they work totally fine for me,
> although there could be some improvements made ;-)

Sure! I was only against:

	switch ($userType):
		case 'fe':
			...
		case 'be':
			...

Instead I would prefer:

abstract class t3lib_user {
}

class t3lib_feuser extends t3lib_user {
}

class t3lib_beuser extends t3lib_user {
}

And only these three classes without any those begroup or so. I thought of
such change too and idea was to implement almost everything (except cookies
names, etc) in the base class. It would also include user switch functionality:

> The inconvinience came from the hook in sysext/beuser
> for switch back, and from the index.php in this "Extentsion"
> where the switch user is implemented.
> 
> Both alter the current users session data by querying the database
> themself instead of using methods from the auth classes.

If that is moved to a base class, than we will get this functionality for
FE users only. Here the abstract class will have an abstract method that
would verify if switching is allowed from user X to user Y. BE and FE
classes will provide appropriate checks.

What do you think?

-- 
Dmitry Dulepov
TYPO3 core&security team member
Twitter: http://twitter.com/dmitryd
Read more @ http://dmitry-dulepov.com/




More information about the TYPO3-dev mailing list