TYPO3 CMS  TYPO3_6-2
Evaluator.php
Go to the documentation of this file.
1 <?php
3 
23 class Evaluator {
24 
32  protected $mode = NULL;
33 
41  public function returnFieldJS() {
42  return 'return value;';
43  }
44 
53  public function evaluateFieldValue($value, $is_in, &$set) {
55  if ($isEnabled) {
56  $isMD5 = preg_match('/[0-9abcdef]{32,32}/', $value);
57  $isDeprecatedSaltedHash = \TYPO3\CMS\Core\Utility\GeneralUtility::inList('C$,M$', substr($value, 0, 2));
59  $objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(NULL, $this->mode);
60  if ($isMD5) {
61  $set = TRUE;
62  $value = 'M' . $objInstanceSaltedPW->getHashedPassword($value);
63  } else {
64  // Determine method used for the (possibly) salted hashed password
65  $tempValue = $isDeprecatedSaltedHash ? substr($value, 1) : $value;
66  $tempObjInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance($tempValue);
67  if (!is_object($tempObjInstanceSaltedPW)) {
68  $set = TRUE;
69  $value = $objInstanceSaltedPW->getHashedPassword($value);
70  }
71  }
72  }
73  return $value;
74  }
75 
76 }
static getSaltingInstance($saltedHash='', $mode=TYPO3_MODE)
Definition: SaltFactory.php:83