[BUGFIX] saltedpasswords: Check rsaauth loading 59/29859/7
authorNicole Cordes <typo3@cordes.co>
Sun, 4 May 2014 17:45:48 +0000 (19:45 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 4 May 2014 20:03:46 +0000 (22:03 +0200)
This patch adds the loading check of rsaauth before trying to access the
BackendFactory of rsaauth. Otherwise the extension manager gets broken
on entering extension configuration.

Resolves: #58504
Releases: 6.2, 6.1
Change-Id: I197fb5e032b31e6add388269f77e6fc834e45b54
Reviewed-on: https://review.typo3.org/29859
Reviewed-by: Markus Klein
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/saltedpasswords/Classes/Utility/ExtensionManagerConfigurationUtility.php

index f2d5042..b22d0f3 100644 (file)
@@ -290,13 +290,23 @@ usage:<br />
 <br />
 Make sure that the Login Security Level is not set to "" or "challenged"!';
                        } elseif (trim($GLOBALS['TYPO3_CONF_VARS']['FE']['loginSecurityLevel']) === 'rsa') {
-                               if ($this->isRsaAuthBackendAvailable()) {
-                                       $this->setErrorLevel('ok');
-                                       $problems[] = 'The frontend is configured to use SaltedPasswords with RSA authentication.';
+                               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rsaauth')) {
+                                       if ($this->isRsaAuthBackendAvailable()) {
+                                               $this->setErrorLevel('ok');
+                                               $problems[] = 'The frontend is configured to use SaltedPasswords with RSA authentication.';
+                                       } else {
+                                               // This means that login would fail because rsaauth is not working properly
+                                               $this->setErrorLevel('error');
+                                               $problems[] = '<strong>Using the extension "rsaauth" is not possible, as no encryption backend '
+                                                       . 'is available. Please install and configure the PHP extension "openssl". '
+                                                       . 'See <a href="http://php.net/manual/en/openssl.installation.php" target="_blank">PHP.net</a></strong>.';
+                                       }
                                } else {
-                                       // This means that login would fail because rsaauth is not working properly
-                                       $this->setErrorLevel('error');
-                                       $problems[] = '<strong>Using the extension "rsaauth" is not possible, as no encryption backend ' . 'is available. Please install and configure the PHP extension "openssl". ' . 'See <a href="http://php.net/manual/en/openssl.installation.php" target="_blank">PHP.net</a></strong>.';
+                                       // Rsaauth is not installed but configured to be used
+                                       $this->setErrorLevel('warning');
+                                       $problems[] = 'The "rsaauth" extension is not installed, but TYPO3 CMS is configured to use it.'
+                                               . ' Either install the extension or adapt the configuration by setting [FE][loginSecurityLevel]'
+                                               . ' to "normal" in the Install Tool.';
                                }
                        }
                        // Only saltedpasswords as authsservice