/**
  * Checks if the given value is a valid recaptcha.
  *
  * @param mixed $value The value that should be validated
  * @throws InvalidVariableException
  */
 public function isValid($value)
 {
     $response = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('g-recaptcha-response');
     if ($response !== null) {
         // Only check if a response is set
         $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
         $fullTs = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
         $reCaptchaSettings = $fullTs['plugin.']['tx_sfeventmgt.']['settings.']['reCaptcha.'];
         if (isset($reCaptchaSettings) && is_array($reCaptchaSettings) && isset($reCaptchaSettings['secretKey']) && $reCaptchaSettings['secretKey']) {
             $ch = curl_init();
             $fields = ['secret' => $reCaptchaSettings['secretKey'], 'response' => $response];
             // url-ify the data for the POST
             $fieldsString = '';
             foreach ($fields as $key => $value) {
                 $fieldsString .= $key . '=' . $value . '&';
             }
             rtrim($fieldsString, '&');
             // set the url, number of POST vars, POST data
             curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify');
             curl_setopt($ch, CURLOPT_POST, count($fields));
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsString);
             // execute post
             $resultCH = json_decode(curl_exec($ch));
             if (!(bool) $resultCH->success) {
                 $this->addError(LocalizationUtility::translate('validation.possible_robot', 'sf_event_mgt'), 1231423345);
             }
         } else {
             throw new InvalidVariableException(LocalizationUtility::translate('error.no_secretKey', 'sf_event_mgt'), 1358349150);
         }
     }
 }
 /**
  * Set up dependencies
  */
 public function setUp()
 {
     parent::setUp();
     $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
     $this->queue = $this->objectManager->get(BeanstalkdQueue::class, self::QUEUE_NAME, []);
     /** @var Pheanstalk\Pheanstalk $client */
     $client = $this->queue->getClient();
     // flush queue:
     try {
         while (true) {
             $job = $client->peekDelayed(self::QUEUE_NAME);
             $client->delete($job);
         }
     } catch (\Exception $e) {
     }
     try {
         while (true) {
             $job = $client->peekBuried(self::QUEUE_NAME);
             $client->delete($job);
         }
     } catch (\Exception $e) {
     }
     try {
         while (true) {
             $job = $client->peekReady(self::QUEUE_NAME);
             $client->delete($job);
         }
     } catch (\Exception $e) {
     }
 }
 /**
  * Sets up this test suite.
  */
 public function setUp()
 {
     parent::setUp();
     $this->setUpBackendUserFromFixture(1);
     $this->importDataSet(ORIGINAL_ROOT . 'typo3conf/ext/linkhandler/Tests/Functional/Fixtures/base_structure.xml');
     $this->importDataSet(ORIGINAL_ROOT . 'typo3conf/ext/linkhandler/Tests/Functional/Fixtures/tx_news_domain_model_news.xml');
     /** @var \TYPO3\CMS\Lang\LanguageService $languageService */
     $languageService = $this->getMock('TYPO3\\CMS\\Lang\\LanguageService');
     $GLOBALS['LANG'] = $languageService;
     /** @var \TYPO3\CMS\Core\TimeTracker\TimeTracker $timeTracker */
     $timeTracker = $this->getMock('TYPO3\\CMS\\Core\\TimeTracker\\TimeTracker');
     $GLOBALS['TT'] = $timeTracker;
     /** @var \TYPO3\CMS\Frontend\Page\PageRepository $pageRepository */
     $pageRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
     /** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $typoScriptFrontendController */
     $typoScriptFrontendController = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], 1, 0);
     $this->typoScriptFrontendController = $typoScriptFrontendController;
     $GLOBALS['TSFE'] = $typoScriptFrontendController;
     $typoScriptFrontendController->sys_page = $pageRepository;
     $typoScriptFrontendController->getPageAndRootline();
     $typoScriptFrontendController->initTemplate();
     $typoScriptFrontendController->getConfigArray();
     // This is needed for the configuration manager to load the correct TSconfig.
     $_GET['P'] = array('pid' => 1);
     /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObjectRenderer */
     $contentObjectRenderer = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
     $contentObjectRenderer->start(array());
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     /** @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManager $configurationManager */
     $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
     $configurationManager->setContentObject($contentObjectRenderer);
     $this->uriBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
 }
 /**
  * Get the static file cache
  *
  * @return FrontendInterface
  * @throws NoSuchCacheException
  */
 public static function getCache()
 {
     /** @var CacheManager $cacheManager */
     $objectManager = new ObjectManager();
     $cacheManager = $objectManager->get(CacheManager::class);
     return $cacheManager->getCache('static_file_cache');
 }
Beispiel #5
0
 /**
  * @param array $behaviors
  * @param $object
  * @param $controllerContext
  * @param $default
  * @param array $extraConf
  * @return bool|object
  */
 public function executeBehaviors(array $behaviors, $object, $controllerContext, $default, $extraConf = array())
 {
     $behaviorResponse = false;
     foreach ($behaviors as $behaviorClassName => $enabled) {
         if (is_array($enabled) && $enabled['_typoScriptNodeValue'] == true || !is_array($enabled) && $enabled == true) {
             if (is_array($enabled)) {
                 $conf = $enabled;
             } else {
                 $conf = array();
             }
             $conf = array_merge_recursive($conf, $extraConf);
             $behavior = $this->objectManager->create($behaviorClassName);
             $behavior->setControllerContext($controllerContext);
             $result = $behavior->execute($object, $conf);
             if ($result) {
                 $behaviorResponse = $result;
             }
         }
     }
     if ($behaviorResponse == false) {
         $behaviorResponse = $this->objectManager->create('CIC\\Cicregister\\Behaviors\\Response\\RenderAction');
         $behaviorResponse->setValue($default);
     }
     return $behaviorResponse;
 }
 /**
  * TYPO3 boot
  *
  * @param \Behat\Behat\Context\Context $context
  * @param \Behat\Behat\Hook\Scope\ScenarioScope $scope
  */
 public function TYPO3Boot(&$context = NULL, &$scope = NULL)
 {
     if (!defined('ORIGINAL_ROOT')) {
         define('ORIGINAL_ROOT', strtr(getenv('TYPO3_PATH_WEB') ? getenv('TYPO3_PATH_WEB') . '/' : getcwd() . '/', '\\', '/'));
     }
     if (getenv('BEHAT_TYPO3_DOCROOT') && !defined('BEHAT_ROOT')) {
         define('BEHAT_ROOT', strtr(getenv('BEHAT_TYPO3_DOCROOT'), '\\', '/'));
     }
     $this->typo3BootstrapUtility = defined('BEHAT_ROOT') ? new Typo3BootstrapUtilityStatic() : new Typo3BootstrapUtilityDynamic();
     $this->typo3InstancePath = $this->typo3BootstrapUtility->setUp($scope->getFeature()->getFile(), $this->typo3CoreExtensionsToLoad, $this->typo3TestExtensionsToLoad, $this->typo3PathsToLinkInTestInstance, $this->typo3ConfigurationToUseInTestInstance, $this->typo3AdditionalFoldersToCreate);
     // import db
     if (count($this->typo3DatabaseToImport) > 0) {
         foreach ($this->typo3DatabaseToImport as $path) {
             $this->importDataSet($path);
         }
     }
     // setup fe
     if (count($this->typo3FrontendRootPage) > 0) {
         $this->setupFrontendRootPage($this->typo3FrontendRootPage['pageId'], $this->typo3FrontendRootPage['typoscript'], $this->typo3FrontendRootPage['typoscriptConstants']);
     }
     // rewrite mink parameter
     $this->typo3BootstrapUtility->rewriteMinkParameter($context);
     // preparing object manager
     $this->typo3ObjectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     // preparing persistance manager
     $this->typo3PersistenceManager = $this->typo3ObjectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
 }
 /**
  * Analyses user groups
  *
  * @param array $reports
  * @return void
  */
 protected function analyseUserGroups(&$reports)
 {
     /** @var \AOE\AoeIpauth\Domain\Service\FeEntityService $service */
     $service = $this->objectManager->get('AOE\\AoeIpauth\\Domain\\Service\\FeEntityService');
     $userGroups = $service->findAllGroupsWithIpAuthentication();
     if (empty($userGroups)) {
         // Message that no user group has IP authentication
         $reports[] = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', 'IP Usergroup Authentication', 'No user groups with IP authentication found', 'No user groups were found anywhere that are active and have an automatic IP authentication enabled.' . 'Your current IP is: <strong>' . $this->myIp . '</strong>', \TYPO3\CMS\Reports\Status::INFO);
     } else {
         $thisUrl = urlencode(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
         $userGroupInfo = '<br /><br /><table cellpadding="4" cellspacing="0" border="0">';
         $userGroupInfo .= '<thead><tr><th style="padding-bottom: 10px;">User Group</th><th>IP/Range</th></tr></thead>';
         $userGroupInfo .= '<tbody>';
         // Add user group strings
         foreach ($userGroups as $group) {
             $uid = $group['uid'];
             $ips = implode(', ', $group['tx_aoeipauth_ip']);
             $fullRecord = BackendUtility::getRecord('fe_groups', $uid);
             $title = $fullRecord['title'];
             $button = '<a title="Edit record" onclick="window.location.href=\'alt_doc.php?returnUrl=' . $thisUrl . '&amp;edit[fe_groups][' . $uid . ']=edit\'; return false;" href="#">' . '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-open">&nbsp;</span>' . '</a>';
             $userGroupInfo .= '<tr><td style="padding: 0 20px 0 0;">' . $button . $title . '</td><td>' . $ips . '</td></tr>';
         }
         $userGroupInfo .= '</tbody>';
         $userGroupInfo .= '</table>';
         $userGroupInfo .= '<br /><br />Your current IP is: <strong>' . $this->myIp . '</strong>';
         // Inform about the groups
         $reports[] = $this->objectManager->get('tx_reports_reports_status_Status', 'IP Usergroup Authentication', 'Some groups with automatic IP authentication were found.', $userGroupInfo, \TYPO3\CMS\Reports\Status::OK);
     }
 }
 /**
  * Initialize presets of feature
  *
  * @param array $postValues List of $POST values of this feature
  * @return void
  * @throws Exception
  */
 public function initializePresets(array $postValues)
 {
     // Give feature sub array of $POST values to preset and set to own property
     $featurePostValues = array();
     if (!empty($postValues[$this->name])) {
         $featurePostValues = $postValues[$this->name];
     }
     $this->postValues = $featurePostValues;
     $isNonCustomPresetActive = false;
     $customPresetFound = false;
     foreach ($this->presetRegistry as $presetClass) {
         /** @var PresetInterface $presetInstance */
         $presetInstance = $this->objectManager->get($presetClass);
         if (!$presetInstance instanceof PresetInterface) {
             throw new Exception('Preset ' . $presetClass . ' does not implement PresetInterface', 1378644821);
         }
         $presetInstance->setPostValues($featurePostValues);
         // Custom preset is set active if no preset before is active
         if ($presetInstance->isActive()) {
             $isNonCustomPresetActive = true;
         }
         if ($presetInstance instanceof CustomPresetInterface && !$isNonCustomPresetActive) {
             // Throw Exception if two custom presets are registered
             if ($customPresetFound === true) {
                 throw new Exception('Preset ' . $presetClass . ' implements CustomPresetInterface, but another' . ' custom preset is already registered', 1378645039);
             }
             /** @var CustomPresetInterface $presetInstance */
             $presetInstance->setActive();
             $customPresetFound = true;
         }
         $this->presetInstances[] = $presetInstance;
     }
 }
 /**
  * The main method called by the controller
  *
  * Iterates over the configured post processors and calls them with their
  * own settings
  *
  * @return string HTML messages from the called processors
  */
 public function process()
 {
     $html = '';
     if (is_array($this->postProcessorTypoScript)) {
         $keys = ArrayUtility::filterAndSortByNumericKeys($this->postProcessorTypoScript);
         foreach ($keys as $key) {
             if (!(int) $key || strpos($key, '.') !== false) {
                 continue;
             }
             $className = false;
             $processorName = $this->postProcessorTypoScript[$key];
             $processorArguments = array();
             if (isset($this->postProcessorTypoScript[$key . '.'])) {
                 $processorArguments = $this->postProcessorTypoScript[$key . '.'];
             }
             if (class_exists($processorName, true)) {
                 $className = $processorName;
             } else {
                 $classNameExpanded = 'TYPO3\\CMS\\Form\\PostProcess\\' . ucfirst(strtolower($processorName)) . 'PostProcessor';
                 if (class_exists($classNameExpanded, true)) {
                     $className = $classNameExpanded;
                 }
             }
             if ($className !== false) {
                 $processor = $this->objectManager->get($className, $this->form, $processorArguments);
                 if ($processor instanceof PostProcessorInterface) {
                     $processor->setControllerContext($this->controllerContext);
                     $html .= $processor->process();
                 }
             }
         }
     }
     return $html;
 }
 public function setUp()
 {
     parent::setUp();
     $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
     $this->queue = $this->objectManager->get(DatabaseQueue::class, self::QUEUE_NAME, ['timeout' => 0]);
     $this->setUpBasicFrontendEnvironment();
 }
Beispiel #11
0
 /**
  * This method forwards the call to Bootstrap's run() method. This method is invoked by the mod.php
  * function of TYPO3.
  *
  * @param string $moduleSignature
  * @throws \RuntimeException
  * @return boolean TRUE, if the request request could be dispatched
  * @see run()
  */
 public function callModule($moduleSignature)
 {
     if (!isset($GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature])) {
         return FALSE;
     }
     $moduleConfiguration = $GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature];
     // Check permissions and exit if the user has no permission for entry
     $GLOBALS['BE_USER']->modAccess($moduleConfiguration, TRUE);
     $id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
     if ($id && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($id)) {
         // Check page access
         $permClause = $GLOBALS['BE_USER']->getPagePermsClause(TRUE);
         $access = is_array(\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess((int) $id, $permClause));
         if (!$access) {
             throw new \RuntimeException('You don\'t have access to this page', 1289917924);
         }
     }
     // BACK_PATH is the path from the typo3/ directory from within the
     // directory containing the controller file. We are using mod.php dispatcher
     // and thus we are already within typo3/ because we call typo3/mod.php
     $GLOBALS['BACK_PATH'] = '';
     $configuration = array('extensionName' => $moduleConfiguration['extensionName'], 'pluginName' => $moduleSignature);
     if (isset($moduleConfiguration['vendorName'])) {
         $configuration['vendorName'] = $moduleConfiguration['vendorName'];
     }
     $bootstrap = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Core\\BootstrapInterface');
     $content = $bootstrap->run('', $configuration);
     print $content;
     return TRUE;
 }
 /**
  * Converts string dependencies to an object storage of dependencies
  *
  * @param string $dependencies
  * @return \SplObjectStorage
  */
 public function convertDependenciesToObjects($dependencies)
 {
     $dependenciesObject = new \SplObjectStorage();
     $unserializedDependencies = unserialize($dependencies);
     if (!is_array($unserializedDependencies)) {
         return $dependenciesObject;
     }
     foreach ($unserializedDependencies as $dependencyType => $dependencyValues) {
         // Dependencies might be given as empty string, e.g. conflicts => ''
         if (!is_array($dependencyValues)) {
             continue;
         }
         foreach ($dependencyValues as $dependency => $versions) {
             if ($dependencyType && $dependency) {
                 $versionNumbers = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionsStringToVersionNumbers($versions);
                 $lowest = $versionNumbers[0];
                 if (count($versionNumbers) === 2) {
                     $highest = $versionNumbers[1];
                 } else {
                     $highest = '';
                 }
                 /** @var $dependencyObject \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency */
                 $dependencyObject = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency::class);
                 $dependencyObject->setType($dependencyType);
                 $dependencyObject->setIdentifier($dependency);
                 $dependencyObject->setLowestVersion($lowest);
                 $dependencyObject->setHighestVersion($highest);
                 $dependenciesObject->attach($dependencyObject);
                 unset($dependencyObject);
             }
         }
     }
     return $dependenciesObject;
 }
Beispiel #13
0
 /**
  * Render the different elements and collect the single lines.
  * After the rendering the lines will be imploded. Notice:
  * All methods after this are CType rendering helper
  *
  * @param string $content
  * @param array  $conf
  *
  * @return array
  */
 public function render($content, $conf)
 {
     $lines = array();
     $this->conf = $conf;
     $CType = (string) $this->cObj->data['CType'];
     if (isset($this->conf['forceCType']) && trim($this->conf['forceCType']) !== '') {
         $CType = trim($this->conf['forceCType']);
     }
     $renderer = array('html' => 'FRUIT\\Ink\\Rendering\\Html', 'header' => 'FRUIT\\Ink\\Rendering\\Header', 'table' => 'FRUIT\\Ink\\Rendering\\Table', 'menu' => 'FRUIT\\Ink\\Rendering\\Menu', 'text' => 'FRUIT\\Ink\\Rendering\\Text', 'image' => 'FRUIT\\Ink\\Rendering\\Image', 'textpic' => 'FRUIT\\Ink\\Rendering\\TextPicture', 'templavoila_pi1' => 'FRUIT\\Ink\\Rendering\\Templavoila', 'list' => 'FRUIT\\Ink\\Rendering\\Plugin');
     GeneralUtility::requireOnce(ExtensionManagementUtility::extPath('ink', 'Classes/Rendering/Plugin.php'));
     GeneralUtility::requireOnce(ExtensionManagementUtility::extPath('ink', 'Classes/Rendering/Image.php'));
     GeneralUtility::requireOnce(ExtensionManagementUtility::extPath('ink', 'Classes/Rendering/Menu.php'));
     $objectManager = new ObjectManager();
     /** @var Dispatcher $signalSlot */
     $signalSlot = $objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
     $returnData = $signalSlot->dispatch(__CLASS__, 'renderer', array('renderer' => $renderer));
     $renderer = $returnData['renderer'];
     if (isset($renderer[$CType])) {
         $className = $renderer[$CType];
         /** @var RenderingInterface $renderObject */
         $renderObject = $objectManager->get($className);
         $lines = $renderObject->render($this->cObj, $this->conf);
     } else {
         $lines[] = 'CType: ' . $CType . ' have no rendering definitions';
     }
     $content = implode(LF, $lines);
     return trim($content, CRLF . TAB);
 }
 /**
  * Clear all caches. Therefor it is necessary to login a BE_USER. You have to prevent
  * this function to run on live systems!!!
  */
 public function clearAllCaches()
 {
     /** @var TYPO3\CMS\Core\DataHandling\DataHandler $tce */
     $tce = $this->objectManager->get(TYPO3\CMS\Core\DataHandling\DataHandler::class);
     $tce->start(array(), array());
     $tce->admin = 1;
     $tce->clear_cacheCmd('all');
 }
 /**
  * initialize dependencies an build TSFE
  */
 public function __construct()
 {
     $objectManager = new ObjectManager();
     /** @var BackendUriBuilder $viewHelper */
     $this->uriBuilder = $objectManager->get('I4W\\Fileshare\\Mvc\\Web\\Routing\\BackendUriBuilder');
     $this->configuration = $objectManager->get('I4W\\Fileshare\\TYPO3\\Configuration\\ExtensionConfiguration');
     $this->buildTSFE();
 }
Beispiel #16
0
 /**
  * @param $templatePathPart
  * @param array $data
  * @return string
  */
 protected function getFieldHTML($templatePathPart, $data = array())
 {
     $view = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     /** @var $view \TYPO3\CMS\Fluid\View\StandaloneView */
     $view->assignMultiple($data);
     $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:yag/Resources/Private/Templates/Scheduler/' . $templatePathPart));
     return $view->render();
 }
Beispiel #17
0
 /**
  * PlanningUtility constructor.
  */
 public function __construct()
 {
     $this->objM = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
     $this->sessionRepository = $this->objM->get(AnySessionRepository::class);
     $this->db = $GLOBALS['TYPO3_DB'];
     $dateTimeFormats = $this->db->getDateTimeFormats('tx_sessions_domain_model_session');
     $this->dbDateTimeFormat = $dateTimeFormats['datetime']['format'];
 }
 /**
  * initializes this object
  */
 protected function init()
 {
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->database = $GLOBALS['TYPO3_DB'];
     $this->fileRepository = $this->objectManager->get('TYPO3\\CMS\\Core\\Resource\\FileRepository');
     $fileFactory = ResourceFactory::getInstance();
     $this->storageObject = $fileFactory->getStorageObject($this->storageUid);
 }
 /**
  * Get a provider
  *
  * @param string $name
  *
  * @throws InvalidArgumentValueException
  * @return SitemapProviderInterface
  */
 public static function getProvider($name)
 {
     if (!isset(self::$provider[$name])) {
         throw new InvalidArgumentValueException($name . ' not exists');
     }
     $obj = new ObjectManager();
     return $obj->get($name);
 }
 /**
  * SetUp
  */
 public function setUp()
 {
     parent::setUp();
     $this->importDataSet(__DIR__ . '/Fixtures/tx_schedulertimeline_domain_model_log.xml');
     $this->importDataSet(__DIR__ . '/Fixtures/tx_scheduler_task.xml');
     $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->logRepository = $this->objectManager->get('AOE\\SchedulerTimeline\\Domain\\Repository\\LogRepository');
 }
 /**
  *
  */
 public function setUp()
 {
     $this->testExtensionsToLoad = array('typo3conf/ext/aoe_ipauth');
     parent::setUp();
     /** @var $this->objectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->fixture = $this->objectManager->get('AOE\\AoeIpauth\\Hooks\\Staticfilecache');
 }
 public function setUp()
 {
     parent::setUp();
     $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
     $this->subject = $this->objectManager->get(ImportService::class);
     $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/pages.xml');
     // $this->setUpBasicFrontendEnvironment();
 }
 /**
  *
  */
 public function setUp()
 {
     $this->testExtensionsToLoad = array('typo3conf/ext/aoe_ipauth');
     parent::setUp();
     $this->fixturePath = __DIR__ . '/Fixtures/';
     /** @var $this->objectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
     $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->fixture = $this->objectManager->get('AOE\\AoeIpauth\\Domain\\Service\\FeEntityService');
 }
Beispiel #24
0
 /**
  * Send response to browser
  *
  * @param array $data The response data
  * @return void
  */
 protected function sendResponse(array $data)
 {
     $response = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Response::class);
     $response->setHeader('Content-Type', 'application/json; charset=utf-8');
     $response->setContent(json_encode($data));
     $response->sendHeaders();
     $response->send();
     exit;
 }
 /**
  * CONSTRUCTOR
  */
 public function __construct()
 {
     $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
     $this->injectObjectManager($objectManager);
     $commandManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\CommandManager');
     $this->injectCommandManager($commandManager);
     $reflectionService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     $this->injectReflectionService($reflectionService);
 }
 /**
  *	fe_user-Feld und Passwort-Feld darstellen, damit im Backend das Passwort eines Users geändert werden kann.
  *	Problem: Passwort muss in Tabelle fe_users gespeichert werden, nicht in der Members-Tabelle.
  *	Das Speichern übernimmt per Hook: Nnmembers_Hooks_ProcessDataMapHook
  *
  **/
 function display_sysfilereference_field($PA, $fobj)
 {
     if (!\NNGrad\T3pimper\Utilities\SettingsUtility::isEnabledInConf('falCropping')) {
         return '';
     }
     $this->doc = $this->objectManager->get('\\TYPO3\\CMS\\Backend\\Template\\MediumDocumentTemplate');
     $this->doc->getPageRenderer()->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/css/style.css');
     $this->doc->getPageRenderer()->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/js/jquery.focalpointselect.js');
     $this->doc->getPageRenderer()->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/js/jquery.imgareaselect.js');
     $this->doc->getPageRenderer()->addJsFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3pimper') . 'Resources/Public/TCA/js/scripts.js');
     $table = $PA['table'];
     $field = $PA['field'];
     $row = $PA['row'];
     $selRef = $row[$field];
     $fileRepo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\\TYPO3\\CMS\\Core\\Resource\\FileRepository');
     if (substr($row['uid'], 0, 3) == 'NEW') {
     }
     // Hier gibt es sicher einen besseren Weg?
     $sysFileUid = intval(preg_replace('/[^0-9]/i', '', $row['uid_local']));
     if (!$sysFileUid) {
         return '';
     }
     $sysFileRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_file', 'uid=' . $sysFileUid);
     $sysFileStorage = 'fileadmin';
     if ($sysFileRow['storage'] > 1) {
         $tmp = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'sys_file_storage', 'uid=' . $sysFileRow['storage']);
         $sysFileStorage = $tmp['name'];
     }
     $filename = $sysFileStorage . $sysFileRow['identifier'];
     /*
     // Die eigentlich bessere Art – funktioniert aber nicht bei noch nicht persistierten sys_file_records!
     
     $file = $fileRepo->findFileReferenceByUid($row['uid']);
     $filename = $file->getPublicUrl();
     */
     $TS = $this->settingsUtility->getTsSetup($row['pid']);
     if (!($setup = $TS['imgvariants']['presets'])) {
         return 'Keine Definition in config.t3pimper.imgvariants.presets gefunden.';
     }
     /*
     $image = $this->imageService->getImage($filename, null, false);
     $processingInstructions = array(
     	'maxWidth' => 400,
     	'maxHeight' => 200,
     );
     $processedImage = $this->imageService->applyProcessingInstructions($image, $processingInstructions);
     $imageUri = $this->imageService->getImageUri($processedImage);
     
     
     $arr = array();
     foreach ($setup as $key => $conf) {
     	$arr[] = $key;
     }
     */
     $html = $this->anyHelper->renderTemplate('typo3conf/ext/t3pimper/Resources/Private/TCA/Imgvariants.html', array('uniqid' => uniqid(), 'image' => $filename, 'TS' => $TS['imgvariants'], 'value' => $selRef, 'setup' => $setup, 'arr' => $arr, 'data' => $row, 'table' => $table, 'field' => $field, 'PA' => $PA));
     return $html;
 }
 /**
  * Get all available actions.
  *
  * @return array
  */
 public function databaseCompareAvailableActions()
 {
     $availableActions = array_flip($this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ClassReflection', 'Etobi\\CoreAPI\\Service\\DatabaseComparator')->getConstants());
     foreach ($availableActions as $number => $action) {
         if (!$this->isFirstPartOfString($action, 'ACTION_')) {
             unset($availableActions[$number]);
         }
     }
     return $availableActions;
 }
 public function setUp()
 {
     parent::setUp();
     $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
     $this->itemRepository = $this->objectManager->get(ItemRepository::class);
     $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/pages.xml');
     $this->importDataSet(ORIGINAL_ROOT . 'typo3conf/ext/frp_example/Tests/Functional/Domain/Repository/Fixtures/sys_template.xml');
     $this->importDataSet(ORIGINAL_ROOT . 'typo3conf/ext/frp_example/Tests/Functional/Domain/Repository/Fixtures/item.xml');
     $this->setUpBasicFrontendEnvironment();
 }
 /**
  * Construction function.
  *
  * @param array $duplicationData
  * @param array $duplicationSettings
  * @param array $fieldsValues
  */
 public function __construct(array $duplicationData = array(), array $duplicationSettings = array(), $fieldsValues = array())
 {
     $this->objectManager = Core::getObjectManager();
     $this->database = Core::getDatabase();
     $this->extensionConfiguration = Core::getExtensionConfiguration();
     $this->result = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Error\\Result');
     $this->setDuplicationData($duplicationData);
     $this->setDuplicationSettings($duplicationSettings);
     $this->initializeFields($fieldsValues);
 }
 /**
  * Construction function.
  *
  * @param array $duplicationData
  * @param array $duplicationSettings
  * @param array $fieldsValues
  */
 public function __construct(array $duplicationData = [], array $duplicationSettings = [], $fieldsValues = [])
 {
     $this->objectManager = Core::getObjectManager();
     $this->database = Core::getDatabase();
     $this->extensionConfiguration = Core::getExtensionConfiguration();
     $this->result = $this->objectManager->get(Result::class);
     $this->setDuplicationData($duplicationData);
     $this->setDuplicationSettings($duplicationSettings);
     $this->initializeFields($fieldsValues);
 }