‪TYPO3CMS  9.5
BackendWarnings.php
Go to the documentation of this file.
1 <?php
2 namespace ‪TYPO3\CMS\Rsaauth;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
19 
25 {
31  public function ‪displayWarningMessages_postProcess(array &$warnings)
32  {
34  if ($backend instanceof \‪TYPO3\CMS\Rsaauth\Backend\CommandLineBackend) {
35  // Not using the PHP extension!
36  $lang = $this->‪getLanguageService();
37  $warnings['rsaauth_cmdline'] = $lang->sL('LLL:EXT:rsaauth/Resources/Private/Language/locallang.xlf:hook_using_cmdline');
38  // Check the path
39  $path = trim(GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('rsaauth', 'temporaryDirectory'));
40  if ($path == '') {
41  // Path is empty
42  $warnings['rsaauth'] = $lang->sL('LLL:EXT:rsaauth/Resources/Private/Language/locallang.xlf:hook_empty_directory');
43  } elseif (!GeneralUtility::isAbsPath($path)) {
44  // Path is not absolute
45  $warnings['rsaauth'] = $lang->sL('LLL:EXT:rsaauth/Resources/Private/Language/locallang.xlf:hook_directory_not_absolute');
46  } elseif (!@is_dir($path)) {
47  // Path does not represent a directory
48  $warnings['rsaauth'] = $lang->sL('LLL:EXT:rsaauth/Resources/Private/Language/locallang.xlf:hook_directory_not_exist');
49  } elseif (!@is_writable($path)) {
50  // Directory is not writable
51  $warnings['rsaauth'] = $lang->sL('LLL:EXT:rsaauth/Resources/Private/Language/locallang.xlf:hook_directory_not_writable');
52  } elseif (strpos($path, ‪Environment::getPublicPath()) === 0) {
53  // Directory is inside the site root
54  $warnings['rsaauth'] = $lang->sL('LLL:EXT:rsaauth/Resources/Private/Language/locallang.xlf:hook_directory_inside_siteroot');
55  }
56  }
57  }
58 
64  protected function ‪getLanguageService()
65  {
66  return ‪$GLOBALS['LANG'];
67  }
68 }
‪TYPO3\CMS\Rsaauth\BackendWarnings
Definition: BackendWarnings.php:25
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static string getPublicPath()
Definition: Environment.php:153
‪TYPO3\CMS\Core\Configuration\ExtensionConfiguration
Definition: ExtensionConfiguration.php:42
‪TYPO3
‪TYPO3\CMS\Rsaauth\BackendWarnings\displayWarningMessages_postProcess
‪displayWarningMessages_postProcess(array &$warnings)
Definition: BackendWarnings.php:31
‪TYPO3\CMS\Rsaauth\Backend\BackendFactory\getBackend
‪static AbstractBackend getBackend()
Definition: BackendFactory.php:55
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Rsaauth\BackendWarnings\getLanguageService
‪TYPO3 CMS Core Localization LanguageService getLanguageService()
Definition: BackendWarnings.php:64
‪TYPO3\CMS\Rsaauth