[BUGFIX] Reports module shows unnecessary info text
authorMarkus Klein <klein.t3@mfc-linz.at>
Thu, 15 Dec 2011 01:49:26 +0000 (19:49 -0600)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 28 Jan 2012 17:49:14 +0000 (18:49 +0100)
Do not show saltedpasswords info text in reports module
unless problems have been detected.

Change-Id: I4e3aeffe6bde09cea2a77193cf52672b0b71fa6b
Fixes: #32580
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/8752
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_securitystatus.php

index a1534b4..a81639c 100644 (file)
@@ -254,7 +254,8 @@ class tx_reports_reports_status_SecurityStatus implements tx_reports_StatusProvi
                } else {
                        /** @var tx_saltedpasswords_emconfhelper $configCheck */
                        $configCheck = t3lib_div::makeInstance('tx_saltedpasswords_emconfhelper');
-                       $message .= '<p>' . $GLOBALS['LANG']->getLL('status_saltedPasswords_infoText') . '</p>';
+                       $message = '<p>' . $GLOBALS['LANG']->getLL('status_saltedPasswords_infoText') . '</p>';
+                       $messageDetail = '';
                        $flashMessage = $configCheck->checkConfigurationBackend(array(), new t3lib_tsStyleConfig());
 
                        if (strpos($flashMessage, 'message-error') !== FALSE ||
@@ -263,7 +264,7 @@ class tx_reports_reports_status_SecurityStatus implements tx_reports_StatusProvi
                        ) {
                                $value    = $GLOBALS['LANG']->getLL('status_insecure');
                                $severity = tx_reports_reports_status_Status::ERROR;
-                               $message .= $flashMessage;
+                               $messageDetail .= $flashMessage;
                        }
 
                        $unsecureUserCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
@@ -275,9 +276,14 @@ class tx_reports_reports_status_SecurityStatus implements tx_reports_StatusProvi
                        if ($unsecureUserCount > 0) {
                                $value    = $GLOBALS['LANG']->getLL('status_insecure');
                                $severity = tx_reports_reports_status_Status::ERROR;
-                               $message .= '<div class="typo3-message message-warning">' .
+                               $messageDetail .= '<div class="typo3-message message-warning">' .
                                                $GLOBALS['LANG']->getLL('status_saltedPasswords_notAllPasswordsHashed') .'</div>';
                        }
+
+                       $message .= $messageDetail;
+                       if (empty($messageDetail)) {
+                               $message = '';
+                       }
                }
 
                return t3lib_div::makeInstance('tx_reports_reports_status_Status',