Guest User

Untitled

a guest
Aug 14th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. /**
  2. * action check
  3. *
  4. * @param string $username
  5. * @param string $password
  6. * @return string
  7. */
  8. public function checkAction(string $username, string $password)
  9. {
  10. $user = $this->userRepository->findOneByUsername($username);
  11.  
  12. $saltedPassword = '';
  13.  
  14. if (TYPO3CMSSaltedpasswordsUtilitySaltedPasswordsUtility::isUsageEnabled('FE')) {
  15. $objSalt = TYPO3CMSSaltedpasswordsSaltSaltFactory::getSaltingInstance(NULL);
  16. if (is_object($objSalt)) {
  17. $saltedPassword = $objSalt->getHashedPassword($password);
  18. }
  19. }
  20.  
  21. echo $saltedPassword;
  22. echo "<br>";
  23.  
  24. $saltedPassword = $user->getPassword();
  25. // keeps status if plain-text password matches given salted user password hash
  26. $success = FALSE;
  27.  
  28. if (TYPO3CMSSaltedpasswordsUtilitySaltedPasswordsUtility::isUsageEnabled('FE')) {
  29. $objSalt = TYPO3CMSSaltedpasswordsSaltSaltFactory::getSaltingInstance($saltedPassword);
  30. if (is_object($objSalt)) {
  31. $success = $objSalt->checkPassword($password, $saltedPassword);
  32. }
  33. }
  34. echo $saltedPassword;
  35. return "";
  36. }
Add Comment
Please, Sign In to add comment