diff --git a/ChangeLog b/ChangeLog index 458667e31e88eb76737a0739eb0b58645d37dbd1..0b902f70d5d4d9f387ff593cc991341198a366a7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-01-18 Ingo Renner <ingo@typo3.org> + + * Added feature #17101: [reports] Warning in reports module for enabled PHP safe_mode, credits Christian Kuhn + 2011-01-17 Ernesto Baschny <ernst@cron-it.de> * Follow-up to #15611: Mention the change of behaviour on copy/translate (hidden by default) in NEWS.txt diff --git a/typo3/sysext/reports/ChangeLog b/typo3/sysext/reports/ChangeLog index 6cdfbd08991cc5ba9df042004eca569f0a6b547e..1f0bf9d7d3bf8b95b80c5d05e2f2757efca3e389 100644 --- a/typo3/sysext/reports/ChangeLog +++ b/typo3/sysext/reports/ChangeLog @@ -1,3 +1,7 @@ +2011-01-18 Ingo Renner <ingo@typo3.org> + + * Added feature #17101: Warning in reports module for enabled PHP safe_mode, credits Christian Kuhn + 2011-01-17 Ingo Renner <ingo@typo3.org> * Added feature #17033: Notification Emails for system status updates diff --git a/typo3/sysext/reports/reports/locallang.xml b/typo3/sysext/reports/reports/locallang.xml index 0a396db26776534bf02df843ebb1621550799393..1fee1a882601631921357c49dae4257520db6325 100644 --- a/typo3/sysext/reports/reports/locallang.xml +++ b/typo3/sysext/reports/reports/locallang.xml @@ -26,6 +26,7 @@ <label index="status_configuration">Configuration</label> <label index="status_referenceIndex">Reference Index</label> <label index="status_memcachedConfiguration">Memcached Configuration</label> + <label index="status_PhpSafeMode">PHP safe_mode</label> <label index="status_adminUserAccount">Admin User Account</label> <label index="status_encryptionKey">Encryption Key</label> <label index="status_fileDenyPattern">File Deny Pattern</label> @@ -50,6 +51,7 @@ <label index="status_configuration_DeprecationLogEnabled">The deprecation log tracks whether old APIs are being used in extensions. Depending on the extensions you use and whether they use deprecated APIs it can happen that the log takes up quite some space over time. The more space it takes up, the more it may affect your installation's performance. It is recommended to disable deprecation log in production environments.</label> <label index="status_configuration_DeprecationLogFile">You can find the deprecation log file at %s.</label> <label index="status_configuration_DeprecationLogSize">Your deprecation log file currently takes up %s.</label> + <label index="status_configuration_PhpSafeModeEnabled">PHP INI setting safe_mode "On" is discouraged since PHP 5.2 and deprecated since PHP 5.3 and should not be used anymore.</label> <label index="status_updateTaskTitle">System Status Update</label> <label index="status_updateTaskDescription">Runs a system status check and sends notifications if problems have been found.</label> <label index="status_updateTaskField_notificationEmail">Notification Email Address</label> diff --git a/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php b/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php index 37360c13bce9abe2404b0f48b90b43b33de4dcba..f93f907bb46ab1dc46dbe91c81831d0abf1d1e85 100644 --- a/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php +++ b/typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php @@ -41,7 +41,7 @@ class tx_reports_reports_status_ConfigurationStatus implements tx_reports_Status /** * Backpath to the typo3 main directory - * + * * @var string */ protected $backPath = '../'; @@ -55,7 +55,8 @@ class tx_reports_reports_status_ConfigurationStatus implements tx_reports_Status public function getStatus() { $statuses = array( 'emptyReferenceIndex' => $this->getReferenceIndexStatus(), - 'deprecationLog' => $this->getDeprecationLogStatus() + 'deprecationLog' => $this->getDeprecationLogStatus(), + 'safeModeEnabled' => $this->getPhpSafeModeStatus() ); if ($this->isMemcachedUsed()) { @@ -96,6 +97,27 @@ class tx_reports_reports_status_ConfigurationStatus implements tx_reports_Status ); } + /** + * Checks if PHP safe_mode is enabled. + * + * @return tx_reports_reports_status_Status A tx_reports_reports_status_Status object representing whether the safe_mode is enabled or not + */ + protected function getPhpSafeModeStatus() { + $value = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:disabled'); + $message = ''; + $severity = tx_reports_reports_status_Status::OK; + + if (t3lib_utility_PhpOptions::isSafeModeEnabled()) { + $value = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:enabled'); + $severity = tx_reports_reports_status_Status::WARNING; + $message = $GLOBALS['LANG']->sL('status_configuration_PhpSafeModeEnabled'); + } + + return t3lib_div::makeInstance('tx_reports_reports_status_Status', + $GLOBALS['LANG']->getLL('status_PhpSafeMode'), $value, $message, $severity + ); + } + /** * Checks whether memcached is configured, if that's the case we asume it's also used. *