diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-09-04 11:20:21 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-09-04 11:21:32 +0300 |
commit | ba7ca7767de55da3f3a089373ec611455731a9e5 (patch) | |
tree | 394024adb540e8c70365c3f177a74b72297158e5 /core/Plugin | |
parent | c63ac672b6495f3c50583746a9b5781e223a7991 (diff) |
show warning if debugging on demand is enabled
Diffstat (limited to 'core/Plugin')
-rw-r--r-- | core/Plugin/ControllerAdmin.php | 21 |
1 files changed, 21 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; |