Commit ccdc728c authored by Christoph Pascher's avatar Christoph Pascher
Browse files

replacing deprecated generateRandomHexString call

parent 13932425
...@@ -20,6 +20,7 @@ use TYPO3\Election\Domain\Model\Configuration; ...@@ -20,6 +20,7 @@ use TYPO3\Election\Domain\Model\Configuration;
use TYPO3\Election\Domain\Model\ElectionCircular; use TYPO3\Election\Domain\Model\ElectionCircular;
use TYPO3\Election\Domain\Model\ElectionInvitation; use TYPO3\Election\Domain\Model\ElectionInvitation;
use TYPO3\Election\Domain\Model\Elector; use TYPO3\Election\Domain\Model\Elector;
use TYPO3\CMS\Core\Crypto\Random;
/** /**
* Class ElectionInvitationService * Class ElectionInvitationService
...@@ -49,7 +50,7 @@ class ElectionInvitationService ...@@ -49,7 +50,7 @@ class ElectionInvitationService
$electionInvitation = new ElectionInvitation(); $electionInvitation = new ElectionInvitation();
$electionInvitation->setElector($possibleReceiver); $electionInvitation->setElector($possibleReceiver);
$electionInvitation->setElectionCircular($electionCircular); $electionInvitation->setElectionCircular($electionCircular);
$electionInvitation->setSecret(GeneralUtility::getRandomHexString(mt_rand(180, 220))); $electionInvitation->setSecret(GeneralUtility::makeInstance(Random::class)->generateRandomHexString(mt_rand(180,220)));
$this->electionInvitationRepository->add($electionInvitation); $this->electionInvitationRepository->add($electionInvitation);
$this->electionInvitationRepository->persistAll(); $this->electionInvitationRepository->persistAll();
$electionInvitation->setSuccess($this->sendElectionInvitation($configuration, $electionInvitation)); $electionInvitation->setSuccess($this->sendElectionInvitation($configuration, $electionInvitation));
......
...@@ -22,6 +22,7 @@ use TYPO3\Election\Domain\Model\ElectionCircular; ...@@ -22,6 +22,7 @@ use TYPO3\Election\Domain\Model\ElectionCircular;
use TYPO3\Election\Domain\Model\ElectionInvitation; use TYPO3\Election\Domain\Model\ElectionInvitation;
use TYPO3\Election\Domain\Model\Elector; use TYPO3\Election\Domain\Model\Elector;
use TYPO3\Election\Domain\Repository\ElectionInvitationRepository; use TYPO3\Election\Domain\Repository\ElectionInvitationRepository;
use TYPO3\CMS\Core\Crypto\Random;
/** /**
* Class MailUtility * Class MailUtility
...@@ -46,7 +47,7 @@ class MailUtility ...@@ -46,7 +47,7 @@ class MailUtility
$electionInvitation = new ElectionInvitation(); $electionInvitation = new ElectionInvitation();
$electionInvitation->setElector($elector); $electionInvitation->setElector($elector);
$electionInvitation->setElectionCircular($electionCircular); $electionInvitation->setElectionCircular($electionCircular);
$electionInvitation->setSecret(GeneralUtility::getRandomHexString(mt_rand(180, 220))); $electionInvitation->setSecret(GeneralUtility::makeInstance(Random::class)->generateRandomHexString(mt_rand(180,220)));
$electionInvitationRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(ElectionInvitationRepository::class); $electionInvitationRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(ElectionInvitationRepository::class);
$electionInvitationRepository->add($electionInvitation); $electionInvitationRepository->add($electionInvitation);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment