Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Plugin/ControllerAdmin.php21
-rw-r--r--lang/en.json1
2 files changed, 22 insertions, 0 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php
index c82fcaf92b..cf9a9888be 100644
--- a/core/Plugin/ControllerAdmin.php
+++ b/core/Plugin/ControllerAdmin.php
@@ -11,12 +11,14 @@ namespace Piwik\Plugin;
use Piwik\Config as PiwikConfig;
use Piwik\Config;
use Piwik\Date;
+use Piwik\Development;
use Piwik\Menu\MenuAdmin;
use Piwik\Menu\MenuTop;
use Piwik\Menu\MenuUser;
use Piwik\Notification;
use Piwik\Notification\Manager as NotificationManager;
use Piwik\Piwik;
+use Piwik\Tracker\TrackerConfig;
use Piwik\Url;
use Piwik\Version;
use Piwik\View;
@@ -140,6 +142,24 @@ abstract class ControllerAdmin extends Controller
NotificationManager::notify('PHP53VersionCheck', $notification);
}
+ private static function notifyWhenDebugOnDemandIsEnabled()
+ {
+ if (!Development::isEnabled()
+ && Piwik::hasUserSuperUserAccess() &&
+ TrackerConfig::getConfigValue('debug_on_demand')) {
+
+ $message = Piwik::translate('General_WarningDebugOnDemandEnabled');
+ $message = sprintf($message, '"[Tracker]debug_on_demand"', '"0"', '"config/config.ini.php"');
+ $notification = new Notification($message);
+ $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('DebugOnDemand', $notification);
+ }
+ }
+
/**
* Assigns view properties that would be useful to views that render admin pages.
*
@@ -185,6 +205,7 @@ abstract class ControllerAdmin extends Controller
self::checkPhpVersion($view);
self::notifyWhenPhpVersionIsEOL();
+ self::notifyWhenDebugOnDemandIsEnabled();
$adminMenu = MenuAdmin::getInstance()->getMenu();
$view->adminMenu = $adminMenu;
diff --git a/lang/en.json b/lang/en.json
index 99beab0949..01c5ed18f1 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -388,6 +388,7 @@
"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.",
"WarningPasswordStored": "%sWarning:%s This password will be stored in the config file visible to everybody who can access it.",
+ "WarningDebugOnDemandEnabled": "Debugging Tracker on demand is enabled. For security reasons this should be enabled only for a short time frame. To disable it set %s to %s in %s",
"Website": "Website",
"Weekly": "Weekly",
"WeeklyReport": "weekly",