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:
authorMatthieu Aubry <matt@piwik.org>2016-01-20 00:50:43 +0300
committerMatthieu Aubry <matt@piwik.org>2016-01-20 00:50:43 +0300
commitbfa650da65a017143a99d235c3648449a61e823a (patch)
treed6238c46a21580d6e6a8878586767cc56550e853
parente3e0436605f6c908b20f68f937a1b662ebbefa95 (diff)
parent0c8b27b83d4cfb9309e517329369196187004023 (diff)
Merge pull request #9570 from ashleighpearson/9305
Show a warning when Piwik is used as a SuperUser via HTTP
-rw-r--r--core/Plugin/ControllerAdmin.php28
-rw-r--r--lang/en.json1
2 files changed, 29 insertions, 0 deletions
diff --git a/core/Plugin/ControllerAdmin.php b/core/Plugin/ControllerAdmin.php
index 8e4715cfb9..37ce526b8b 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,31 @@ abstract class ControllerAdmin extends Controller
self::setBasicVariablesAdminView($view);
}
+ private static function notifyIfURLIsNotSecure()
+ {
+ $isURLSecure = ProxyHttp::isHttps();
+ if ($isURLSecure) {
+ return;
+ }
+
+ if (!Piwik::hasUserSuperUserAccess()) {
+ 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 +130,7 @@ abstract class ControllerAdmin extends Controller
}
}
+
private static function notifyIfEAcceleratorIsUsed()
{
$isEacceleratorUsed = ini_get('eaccelerator.enable');
@@ -195,6 +222,7 @@ abstract class ControllerAdmin extends Controller
{
self::notifyWhenTrackingStatisticsDisabled();
self::notifyIfEAcceleratorIsUsed();
+ self::notifyIfURLIsNotSecure();
$view->topMenu = MenuTop::getInstance()->getMenu();
$view->userMenu = MenuUser::getInstance()->getMenu();
diff --git a/lang/en.json b/lang/en.json
index 8ba3ca134f..95556d3c8d 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -86,6 +86,7 @@
"ConfigFileIsNotWritable": "The Piwik configuration file %s is not writable, some of your changes might not be saved. %s Please change permissions of the config file to make it writable.",
"Continue": "Continue",
"ContinueToPiwik": "Continue to Piwik",
+ "CurrentlyUsingUnsecureHttp": "You are currently using Piwik over unsecure HTTP, which can be risky. We recommend you set up Piwik to use SSL (HTTPS) for improved security.",
"CurrentMonth": "Current Month",
"CurrentWeek": "Current Week",
"CurrentYear": "Current Year",