Compare commits

...

9 Commits

Author SHA1 Message Date
phil
f2c9f81af5 [BUGFIX] Api utility does not resolve LazyLoadingProxy 2025-03-31 18:24:21 +02:00
wadichaabene
22a5b811b6 [BUGFIX] Remove last commit about Backend Table Mask 2025-03-24 11:50:38 +01:00
wadichaabene
2d9bc26ce6 [BUGFIX] Mask: Fix Backend Table Mask FMC0-I17 2025-03-22 15:16:27 +01:00
wadichaabene
9acf239483 [BUGFIX] Fix Language in typo3 9.5 2025-03-10 22:32:37 +01:00
wadichaabene
cd116df569 [BUGFIX] Change protection page form 2025-01-31 21:52:58 +01:00
wadichaabene
dede4d0efa [BUGFIX] Adapt Argument php 8 2025-01-31 21:42:13 +01:00
nourmkaouar
c191e6e635 [BUGFIX] Adapt mail to the new format 2025-01-17 17:58:34 +01:00
nourmkaouar
74f9767cf4 [TASK] add captcha validator 2025-01-06 17:47:49 +01:00
nourmkaouar
6f1383ce50 [TASK] Add DataProtection link 2024-12-30 15:10:07 +01:00
4 changed files with 45 additions and 4 deletions

View File

@ -27,6 +27,7 @@ use TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder;
use TYPO3\CMS\Extbase\Service\EnvironmentService; use TYPO3\CMS\Extbase\Service\EnvironmentService;
use TYPO3\CMS\Extbase\Service\ExtensionService; use TYPO3\CMS\Extbase\Service\ExtensionService;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use Blueways\BwCaptcha\Validation\Validator\CaptchaValidator;
class ActionController extends BaseController class ActionController extends BaseController
{ {
@ -584,7 +585,7 @@ class ActionController extends BaseController
if (in_array($argument->getName(), ['step', 'submit', $object])) { if (in_array($argument->getName(), ['step', 'submit', $object])) {
continue; continue;
} }
if (method_exists($argument->getValue(), 'getUid')) { if (is_string($argument->getValue()) && method_exists($argument->getValue(), 'getUid')) {
$pluginArguments[$argument->getName()] $pluginArguments[$argument->getName()]
= $argument->getValue()->getUid(); = $argument->getValue()->getUid();
} else { } else {
@ -835,4 +836,26 @@ class ActionController extends BaseController
); );
} }
} }
/** **/
protected function valideCaptcha($captchaId, $value
) {
$cacheIdentifier = $GLOBALS['TSFE']->fe_user->getKey('ses', $captchaId);
if (!$cacheIdentifier) {
$this->addValidationError(
'captcha',
'validator.notvalid'
);
}
// get captcha secret from cache and compare
$cache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('bwcaptcha');
$phrase = $cache->get($cacheIdentifier);
if ($phrase && $phrase === $value) {
return true;
}
$this->addValidationError(
'captcha',
'validator.notvalid'
);
}
} }

View File

@ -41,7 +41,11 @@ class TranslationController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
$languageFactory = GeneralUtility::makeInstance( $languageFactory = GeneralUtility::makeInstance(
LocalizationFactory::class LocalizationFactory::class
); );
$language = $this->request->getAttribute('language'); if (version_compare(TYPO3_branch, '10.0', '>=')) {
$language = $this->request->getAttribute('language');
} else {
$language = $GLOBALS['TYPO3_REQUEST']->getAttribute('language');
}
$locale = $language->getLocale(); $locale = $language->getLocale();
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump( //\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(
// $locale, '$locale', 3, true, false // $locale, '$locale', 3, true, false

View File

@ -17,6 +17,7 @@ use TYPO3\CMS\Core\Resource\FileReference as CoreFileReference;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Domain\Model\FileReference as ExtbaseFileReference; use TYPO3\CMS\Extbase\Domain\Model\FileReference as ExtbaseFileReference;
use TYPO3\CMS\Extbase\Object\ObjectManager; use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage; use TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage; use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
use TYPO3\CMS\Extbase\Service\ImageService; use TYPO3\CMS\Extbase\Service\ImageService;
@ -76,6 +77,9 @@ class ApiUtility
if (substr($method, 0, 3) === 'get') { if (substr($method, 0, 3) === 'get') {
$methodResult = call_user_func([$row, $method]); $methodResult = call_user_func([$row, $method]);
$attributeName = lcfirst(substr($method, 3)); $attributeName = lcfirst(substr($method, 3));
if (get_class($methodResult) == LazyLoadingProxy::class) {
$methodResult = $methodResult->_loadRealInstance();
}
$propertieResults[$attributeName] = $methodResult; $propertieResults[$attributeName] = $methodResult;
} }
} }

View File

@ -21,7 +21,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Fluid\View\TemplatePaths; use TYPO3\CMS\Fluid\View\TemplatePaths;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use Symfony\Component\Mime\Address; use Symfony\Component\Mime\Address;
use TYPO3\CMS\Frontend\Page\PageRepository;
/** /**
* *
*/ */
@ -221,7 +221,7 @@ class MailUtility
$textView->setTemplate($templateNameText); $textView->setTemplate($templateNameText);
$mail = GeneralUtility::makeInstance(MailMessage::class); $mail = GeneralUtility::makeInstance(MailMessage::class);
if (version_compare(TYPO3_branch, '10.0', '>=')) { if (version_compare(TYPO3_branch, '10.0', '>=')) {
$mail->from(new Address($sender)); $mail->from(new Address(key($sender),$sender[key($sender)]));
$mail->subject($subject); $mail->subject($subject);
} else { } else {
$mail->setFrom($sender); $mail->setFrom($sender);
@ -368,7 +368,17 @@ class MailUtility
if ($assetDomain) { if ($assetDomain) {
$domain = $assetDomain; $domain = $assetDomain;
} }
$dataProtectionPid = $settings['dataProtectionPid'];
$uriBuilder = $objectManager->get(
UriBuilder::class
);
if ($dataProtectionPid) {
$pageRepository = GeneralUtility::makeInstance(PageRepository::class);
$urlPage = $pageRepository->getPage($settings['dataProtectionPid']);
$dataProtectionPid = $domain.$urlPage['slug'];
}
$htmlView->assign('domain', $domain); $htmlView->assign('domain', $domain);
$htmlView->assign('linkDataprotection', $dataProtectionPid);
$textBody = $textView->render(); $textBody = $textView->render();
$htmlBody = $htmlView->render(); $htmlBody = $htmlView->render();
if ($domain) { if ($domain) {