40 $saltMethods = static::getDefaultSaltMethods();
41 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'ext/saltedpasswords'][
'saltMethods'])) {
42 $configuredMethods = (array)
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'ext/saltedpasswords'][
'saltMethods'];
43 if (count($configuredMethods) > 0) {
44 if (isset($configuredMethods[0])) {
46 foreach ($configuredMethods as $method) {
47 $saltMethods[$method] = $method;
50 $saltMethods = array_merge($saltMethods, $configuredMethods);
64 'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt',
65 'TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt',
66 'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt' =>
'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt' 88 if (!is_object(self::$instance) || !empty($saltedHash) || $saltedHash === NULL) {
90 if (!empty($saltedHash)) {
91 $result = self::determineSaltingHashingMethod($saltedHash, $mode);
93 self::$instance = NULL;
97 $availableClasses = static::getRegisteredSaltedHashingMethods();
101 return self::$instance;
114 $registeredMethods = static::getRegisteredSaltedHashingMethods();
116 $defaultReference = $registeredMethods[$defaultClassName];
117 unset($registeredMethods[$defaultClassName]);
119 $registeredMethods = array($defaultClassName => $defaultReference) + $registeredMethods;
120 $methodFound = FALSE;
121 foreach ($registeredMethods as $method) {
124 $methodFound = $objectInstance->isValidSaltedPW($saltedHash);
126 self::$instance = $objectInstance;
141 self::$instance = NULL;
143 if (is_object($objectInstance) && is_subclass_of($objectInstance,
'TYPO3\\CMS\\Saltedpasswords\\Salt\\AbstractSalt')) {
144 self::$instance = $objectInstance;
146 return self::$instance;
static setPreferredHashingMethod($resource)
static getRegisteredSaltedHashingMethods()
static determineSaltingHashingMethod($saltedHash, $mode=TYPO3_MODE)
static getSaltingInstance($saltedHash='', $mode=TYPO3_MODE)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
static getDefaultSaltMethods()
static getDefaultSaltingHashingMethod($mode=TYPO3_MODE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]