[TYPO3-dev] Authenticating BE User correctly

Kay Strobach typo3 at kay-strobach.de
Wed Feb 15 18:17:16 CET 2012


Hello Georg,

MANY thanks ;)

Wouldn't it be sensefull to have this function in the class
t3lib_tsfeBeUserAuth or it's parent?

I think this function is used in many extensions and this should be part
of the public API.

Regards
Kay

Am 15.02.2012 16:37, schrieb Georg Ringer:
> Am 15.02.2012 16:37, schrieb Georg Ringer:
>> Hi,
>>
>> this is for FE but should be same for BE when you change FE to BE ;)
> 
> /**
> 	* Check password of user with a given one
> 	*
> 	* @param array $userRecord
> 	* @param string $password
> 	* @return boolean
> 	*/
> private function compareUserRecordWithPassword(array $userRecord,
> $password) {
> 	t3lib_div::requireOnce(t3lib_extMgm::extPath('saltedpasswords',
> 'classes/salts/class.tx_saltedpasswords_salts_factory.php'));
> 
> 	$this->objInstanceSaltedPW =
> tx_saltedpasswords_salts_factory::getSaltingInstance($userRecord['password'],
> 'FE');
> 	if (!is_object($this->objInstanceSaltedPW)) {
> 		$isValid = md5($password) == $userRecord['password'];
> 		return $isValid;
> 		#throw new Exception ('No Password-Factory found');
> 	}
> 	$validPassword = $this->objInstanceSaltedPW->checkPassword($password,
> $userRecord['password']);
> 	return $validPassword;
> }


-- 
http://www.kay-strobach.de - Open Source Rocks

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org

Answere was usefull: https://flattr.com/profile/kaystrobach



More information about the TYPO3-dev mailing list