diff options
author | Matthieu Aubry <matt@piwik.org> | 2014-09-24 04:03:59 +0400 |
---|---|---|
committer | Matthieu Aubry <matt@piwik.org> | 2014-09-24 04:03:59 +0400 |
commit | 43716dff5f97d75ee4e215178ff8d52b5d0c373c (patch) | |
tree | e63cdd9198fcf85c93a3bcd76784d09b3dcf8918 | |
parent | ea03d577404ca86dec5a936f0eaf66b504a3ab23 (diff) | |
parent | 864f13a18bb51917f0b063b4fb64449461da9ab0 (diff) |
Merge pull request #6275 from piwik/6056_warningPHP5.3
Display a warning in admin to super users in case PHP 5.3 is used fixes #6056
-rw-r--r-- | core/Plugin/ControllerAdmin.php | 18 | ||||
-rw-r--r-- | lang/en.json | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index e37cd7b11b..b18fe67de6 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -65,7 +65,7 @@ abstract class ControllerAdmin extends Controller $notification = new Notification($invalidPluginsWarning); $notification->raw = true; $notification->context = Notification::CONTEXT_WARNING; - $notification->title = Piwik::translate('General_Warning') . ':'; + $notification->title = Piwik::translate('General_Warning'); Notification\Manager::notify('ControllerAdmin_InvalidPluginsWarning', $notification); } @@ -178,6 +178,16 @@ abstract class ControllerAdmin extends Controller self::checkPhpVersion($view); + if (Piwik::hasUserSuperUserAccess() && self::isPhpVersion53()) { + $notification = new Notification(Piwik::translate('General_WarningPhpVersionXIsTooOld', '5.3')); + $notification->title = Piwik::translate('General_Warning'); + $notification->priority = Notification::PRIORITY_LOW; + $notification->context = Notification::CONTEXT_WARNING; + $notification->type = Notification::TYPE_TRANSIENT; + $notification->flags = Notification::FLAG_NO_CLEAR; + NotificationManager::notify('PHP53VersionCheck', $notification); + } + $adminMenu = MenuAdmin::getInstance()->getMenu(); $view->adminMenu = $adminMenu; @@ -207,4 +217,10 @@ abstract class ControllerAdmin extends Controller $view->phpVersion = PHP_VERSION; $view->phpIsNewEnough = version_compare($view->phpVersion, '5.3.0', '>='); } + + private static function isPhpVersion53() + { + return strpos(PHP_VERSION, '5.3') === 0; + } + } diff --git a/lang/en.json b/lang/en.json index 2a69e3d7e0..0af012ecc3 100644 --- a/lang/en.json +++ b/lang/en.json @@ -428,6 +428,7 @@ "VisitType": "Visitor type", "VisitTypeExample": "For example, to select all visitors who have returned to the website, including those who have bought something in their previous visits, the API request would contain %s", "Warning": "Warning", + "WarningPhpVersionXIsTooOld": "The PHP version %s you are using has reached its End of Life (EOL). You are strongly urged to upgrade to a current version, as using this version may expose you to security vulnerabilities and bugs that have been fixed in more recent versions of PHP.", "WarningFileIntegrityNoManifest": "File integrity check could not be performed due to missing manifest.inc.php.", "WarningFileIntegrityNoManifestDeployingFromGit": "If you are deploying Piwik from Git, this message is normal.", "WarningFileIntegrityNoMd5file": "File integrity check could not be completed due to missing md5_file() function.", |