diff options
author | Stefan Giehl <stefan@piwik.org> | 2018-05-21 02:15:37 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-05-21 02:15:37 +0300 |
commit | d87cd4d3413912ce2e3452d609336201219edd69 (patch) | |
tree | 7479b429e6516ac2be6a0b8db8a25afdcf806f5d /plugins | |
parent | 212b7b80e0c1c20faa075aa8938d6799bb1b96be (diff) |
Disallow change of GeoIp2 server variables if GeoLocation admin is disabled (#12941)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/GeoIp2/SystemSettings.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/GeoIp2/SystemSettings.php b/plugins/GeoIp2/SystemSettings.php index e2bda72773..1d9765160c 100644 --- a/plugins/GeoIp2/SystemSettings.php +++ b/plugins/GeoIp2/SystemSettings.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\GeoIp2; use Piwik\Piwik; use Piwik\Plugins\GeoIp2\LocationProvider\GeoIp2\ServerModule; +use Piwik\Plugins\UserCountry\UserCountry; use Piwik\Settings\Setting; use Piwik\Settings\FieldConfig; @@ -25,8 +26,11 @@ class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings { $this->title = Piwik::translate('GeoIp2_ServerBasedVariablesConfiguration'); + $geoIpAdminEnabled = UserCountry::isGeoLocationAdminEnabled(); + foreach (ServerModule::$defaultGeoIpServerVars as $name => $value) { $this->geoIp2variables[$name] = $this->createGeoIp2ServerVarSetting($name, $value); + $this->geoIp2variables[$name]->setIsWritableByCurrentUser($geoIpAdminEnabled); } } |