diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2016-02-14 23:10:26 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2016-02-14 23:10:26 +0300 |
commit | 2bae9d90f860f3ccc5598420eb978cafd598451e (patch) | |
tree | b742afddcfc882de15b9c075522cee4eae680db6 /core/Plugin/ControllerAdmin.php | |
parent | 41b579a9d94a05f7c0cb2e42bf7c03c2d374ed95 (diff) |
merge master => 3.0
Diffstat (limited to 'core/Plugin/ControllerAdmin.php')
-rw-r--r-- | core/Plugin/ControllerAdmin.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php index 7c8a1be211..a0658c4142 100644 --- a/core/Plugin/ControllerAdmin.php +++ b/core/Plugin/ControllerAdmin.php @@ -21,6 +21,7 @@ use Piwik\Tracker\TrackerConfig; use Piwik\Url; use Piwik\Version; use Piwik\View; +use Piwik\ProxyHttp; /** * Base class of plugin controllers that provide administrative functionality. @@ -86,6 +87,36 @@ abstract class ControllerAdmin extends Controller self::setBasicVariablesAdminView($view); } + private static function notifyIfURLIsNotSecure() + { + $isURLSecure = ProxyHttp::isHttps(); + if ($isURLSecure) { + return; + } + + if (!Piwik::hasUserSuperUserAccess()) { + return; + } + + if(Url::isLocalHost(Url::getCurrentHost())) { + return; + } + + + $message = Piwik::translate('General_CurrentlyUsingUnsecureHttp'); + + $message .= " "; + + $message .= Piwik::translate('General_ReadThisToLearnMore', + array('<a rel="noreferrer" target="_blank" href="https://piwik.org/faq/how-to/faq_91/">', '</a>') + ); + + $notification = new Notification($message); + $notification->context = Notification::CONTEXT_WARNING; + $notification->raw = true; + Notification\Manager::notify('ControllerAdmin_HttpIsUsed', $notification); + } + /** * @ignore */ @@ -104,6 +135,7 @@ abstract class ControllerAdmin extends Controller } } + private static function notifyIfEAcceleratorIsUsed() { $isEacceleratorUsed = ini_get('eaccelerator.enable'); @@ -184,6 +216,7 @@ abstract class ControllerAdmin extends Controller { self::notifyWhenTrackingStatisticsDisabled(); self::notifyIfEAcceleratorIsUsed(); + self::notifyIfURLIsNotSecure(); $view->topMenu = MenuTop::getInstance()->getMenu(); $view->userMenu = MenuUser::getInstance()->getMenu(); |