diff options
Diffstat (limited to 'plugins')
33 files changed, 274 insertions, 130 deletions
diff --git a/plugins/API/API.php b/plugins/API/API.php index b0a9147b47..e04d3fea4e 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -54,6 +54,7 @@ class API extends \Piwik\Plugin\API public function getPiwikVersion() { Piwik::checkUserHasSomeViewAccess(); + Piwik::checkUserIsNotAnonymous(); return Version::VERSION; } diff --git a/plugins/API/Menu.php b/plugins/API/Menu.php index d9048617ed..a76f87ee0e 100644 --- a/plugins/API/Menu.php +++ b/plugins/API/Menu.php @@ -11,9 +11,12 @@ namespace Piwik\Plugins\API; use Piwik\Menu\MenuTop; use Piwik\Menu\MenuUser; use Piwik\Piwik; +use DeviceDetector\Parser\OperatingSystem; class Menu extends \Piwik\Plugin\Menu { + const DD_SHORT_NAME_ANDROID = 'AND'; + const DD_SHORT_NAME_IOS = 'IOS'; public function configureTopMenu(MenuTop $menu) { @@ -34,14 +37,13 @@ class Menu extends \Piwik\Plugin\Menu return; } - if (!class_exists("DeviceDetector")) { + if (!class_exists("DeviceDetector\\DeviceDetector")) { throw new \Exception("DeviceDetector could not be found, maybe you are using Piwik from git and need to have update Composer. <br>php composer.phar update"); } - $ua = new \DeviceDetector($_SERVER['HTTP_USER_AGENT']); - $ua->parse(); - $os = $ua->getOs('short_name'); - if ($os && in_array($os, array('AND', 'IOS'))) { + $ua = new OperatingSystem($_SERVER['HTTP_USER_AGENT']); + $parsedOS = $ua->parse(); + if (!empty($parsedOS['short_name']) && in_array($parsedOS['short_name'], array(self::DD_SHORT_NAME_ANDROID, self::DD_SHORT_NAME_IOS))) { $menu->add('Piwik Mobile App', null, array('module' => 'Proxy', 'action' => 'redirect', 'url' => 'http://piwik.org/mobile/'), true, 4); } } diff --git a/plugins/CoreConsole/Commands/GenerateWidget.php b/plugins/CoreConsole/Commands/GenerateWidget.php index 836ea3970a..c3360e10fe 100644 --- a/plugins/CoreConsole/Commands/GenerateWidget.php +++ b/plugins/CoreConsole/Commands/GenerateWidget.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/CoreHome/Controller.php b/plugins/CoreHome/Controller.php index 3c90049ca2..487f30883e 100644 --- a/plugins/CoreHome/Controller.php +++ b/plugins/CoreHome/Controller.php @@ -241,7 +241,7 @@ class Controller extends \Piwik\Plugin\Controller $view = new View('@CoreHome/getPromoVideo'); $view->shareText = Piwik::translate('CoreHome_SharePiwikShort'); $view->shareTextLong = Piwik::translate('CoreHome_SharePiwikLong'); - $view->promoVideoUrl = 'http://www.youtube.com/watch?v=OslfF_EH81g'; + $view->promoVideoUrl = 'https://www.youtube.com/watch?v=OslfF_EH81g'; return $view->render(); } diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 2fb65b40b4..915139d300 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -86,6 +86,9 @@ class RowEvolution if (empty($this->apiMethod)) throw new Exception("Parameter apiMethod not set."); $this->label = ResponseBuilder::getLabelFromRequest($_GET); + if(!is_array($this->label)) { + throw new Exception("Expected label to be an array, got instead: " . $this->label); + } $this->label = $this->label[0]; if ($this->label === '') throw new Exception("Parameter label not set."); diff --git a/plugins/CoreHome/Widgets.php b/plugins/CoreHome/Widgets.php index 5aba86a2cd..c2bfc76448 100644 --- a/plugins/CoreHome/Widgets.php +++ b/plugins/CoreHome/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/CoreHome/templates/getPromoVideo.twig b/plugins/CoreHome/templates/getPromoVideo.twig index 0fa24bc5cb..36d94381a9 100755 --- a/plugins/CoreHome/templates/getPromoVideo.twig +++ b/plugins/CoreHome/templates/getPromoVideo.twig @@ -42,7 +42,7 @@ var promoEmbed = $('#piwik-promo-embed'), widgetWidth = $(this).closest('.widgetContent').width(), height = (266 * widgetWidth) / 421, - embedHtml = '<iframe width="100%" height="' + height + '" src="http://www.youtube.com/embed/OslfF_EH81g?autoplay=1&vq=hd720&wmode=transparent" frameborder="0" wmode="Opaque"></iframe>'; + embedHtml = '<iframe width="100%" height="' + height + '" src="https://www.youtube-nocookie.com/embed/OslfF_EH81g?autoplay=1&vq=hd720&wmode=transparent" frameborder="0" wmode="Opaque"></iframe>'; $(this).hide(); promoEmbed.height(height).html(embedHtml); diff --git a/plugins/Dashboard/Menu.php b/plugins/Dashboard/Menu.php index 95d5a618d4..e972ae7dfd 100644 --- a/plugins/Dashboard/Menu.php +++ b/plugins/Dashboard/Menu.php @@ -15,6 +15,7 @@ use Piwik\Menu\MenuAbstract; use Piwik\Menu\MenuReporting; use Piwik\Menu\MenuTop; use Piwik\Piwik; +use Piwik\Plugins\UsersManager\UserPreferences; use Piwik\Site; /** @@ -41,16 +42,18 @@ class Menu extends \Piwik\Plugin\Menu public function configureTopMenu(MenuTop $menu) { - $tooltip = false; - try { - $idSite = Common::getRequestVar('idSite'); - $tooltip = Piwik::translate('Dashboard_TopLinkTooltip', Site::getNameFor($idSite)); - } catch (Exception $ex) { - // if no idSite parameter, show no tooltip - } + $userPreferences = new UserPreferences(); + $idSite = $userPreferences->getDefaultWebsiteId(); + + $tooltip = Piwik::translate('Dashboard_TopLinkTooltip', Site::getNameFor($idSite)); - $urlParams = array('module' => 'CoreHome', 'action' => 'index'); + $urlParams = array( + 'module' => 'CoreHome', + 'action' => 'index', + 'idSite' => $idSite, + ); $menu->add('Dashboard_Dashboard', null, $urlParams, true, 1, $tooltip); } } + diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php index e42006fa65..57196991fa 100644 --- a/plugins/DevicesDetection/Controller.php +++ b/plugins/DevicesDetection/Controller.php @@ -8,7 +8,7 @@ */ namespace Piwik\Plugins\DevicesDetection; -use DeviceDetector; +use DeviceDetector\DeviceDetector; use Piwik\Common; use Piwik\Db; use Piwik\Piwik; @@ -74,26 +74,27 @@ class Controller extends \Piwik\Plugin\Controller $userAgent = Common::getRequestVar('ua', $_SERVER['HTTP_USER_AGENT'], 'string'); - $parsedUA = DeviceDetector::getInfoFromUserAgent($userAgent); + $uaParser = new DeviceDetector($userAgent); + $uaParser->parse(); $view->userAgent = $userAgent; - $view->browser_name = $parsedUA['browser']['name']; - $view->browser_short_name = $parsedUA['browser']['short_name']; - $view->browser_version = $parsedUA['browser']['version']; - $view->browser_logo = getBrowserLogoExtended($parsedUA['browser']['short_name']); - $view->browser_family = $parsedUA['browser_family']; - $view->browser_family_logo = getBrowserFamilyLogoExtended($parsedUA['browser_family']); - $view->os_name = $parsedUA['os']['name']; - $view->os_logo = getOsLogoExtended($parsedUA['os']['short_name']); - $view->os_short_name = $parsedUA['os']['short_name']; - $view->os_family = $parsedUA['os_family']; - $view->os_family_logo = getOsFamilyLogoExtended($parsedUA['os_family']); - $view->os_version = $parsedUA['os']['version']; - $view->device_type = getDeviceTypeLabel($parsedUA['device']['type']); - $view->device_type_logo = getDeviceTypeLogo($parsedUA['device']['type']); - $view->device_model = $parsedUA['device']['model']; - $view->device_brand = getDeviceBrandLabel($parsedUA['device']['brand']); - $view->device_brand_logo = getBrandLogo($view->device_brand); + $view->browser_name = $uaParser->getClient('name'); + $view->browser_short_name = $uaParser->getClient('short_name'); + $view->browser_version = $uaParser->getClient('version'); + $view->browser_logo = getBrowserLogoExtended($uaParser->getClient('short_name')); + $view->browser_family = \DeviceDetector\Parser\Client\Browser::getBrowserFamily($uaParser->getClient('short_name')); + $view->browser_family_logo = getBrowserFamilyLogoExtended($view->browser_family); + $view->os_name = $uaParser->getOs('name'); + $view->os_logo = getOsLogoExtended($uaParser->getOs('short_name')); + $view->os_short_name = $uaParser->getOs('short_name'); + $view->os_family = \DeviceDetector\Parser\OperatingSystem::getOsFamily($uaParser->getOs('short_name')); + $view->os_family_logo = getOsFamilyLogoExtended($view->os_family); + $view->os_version = $uaParser->getOs('version'); + $view->device_type = getDeviceTypeLabel($uaParser->getDeviceName()); + $view->device_type_logo = getDeviceTypeLogo($uaParser->getDeviceName()); + $view->device_model = $uaParser->getModel(); + $view->device_brand = getDeviceBrandLabel($uaParser->getBrand()); + $view->device_brand_logo = getBrandLogo($uaParser->getBrand()); return $view->render(); } @@ -110,7 +111,7 @@ class Controller extends \Piwik\Plugin\Controller switch ($type) { case 'brands': - $availableBrands = DeviceDetector::$deviceBrands; + $availableBrands = \DeviceDetector\Parser\Device\DeviceParserAbstract::$deviceBrands; foreach ($availableBrands AS $short => $name) { if ($name != 'Unknown') { @@ -120,7 +121,7 @@ class Controller extends \Piwik\Plugin\Controller break; case 'browsers': - $availableBrowsers = DeviceDetector::$browsers; + $availableBrowsers = \DeviceDetector\Parser\Client\Browser::getAvailableBrowsers(); foreach ($availableBrowsers AS $short => $name) { $list[$name] = getBrowserLogoExtended($short); @@ -128,7 +129,7 @@ class Controller extends \Piwik\Plugin\Controller break; case 'browserfamilies': - $availableBrowserFamilies = DeviceDetector::$browserFamilies; + $availableBrowserFamilies = \DeviceDetector\Parser\Client\Browser::getAvailableBrowserFamilies(); foreach ($availableBrowserFamilies AS $name => $browsers) { $list[$name] = getBrowserFamilyLogoExtended($name); @@ -136,29 +137,25 @@ class Controller extends \Piwik\Plugin\Controller break; case 'os': - $availableOSs = DeviceDetector::$osShorts; + $availableOSs = \DeviceDetector\Parser\OperatingSystem::getAvailableOperatingSystems(); - foreach ($availableOSs AS $name => $short) { - if ($name != 'Bot') { - $list[$name] = getOsLogoExtended($short); - } + foreach ($availableOSs AS $short => $name) { + $list[$name] = getOsLogoExtended($short); } break; case 'osfamilies': - $osFamilies = DeviceDetector::$osFamilies; + $osFamilies = \DeviceDetector\Parser\OperatingSystem::getAvailableOperatingSystemFamilies(); foreach ($osFamilies AS $name => $oss) { - if ($name != 'Bot') { - $list[$name] = getOsFamilyLogoExtended($name); - } + $list[$name] = getOsFamilyLogoExtended($name); } break; case 'devicetypes': - $deviceTypes = DeviceDetector::$deviceTypes; + $deviceTypes = \DeviceDetector\Parser\Device\DeviceParserAbstract::getAvailableDeviceTypes(); - foreach ($deviceTypes AS $name) { + foreach ($deviceTypes AS $name => $id) { $list[$name] = getDeviceTypeLogo($name); } break; diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php index 1cf8c87e95..af76162f01 100644 --- a/plugins/DevicesDetection/functions.php +++ b/plugins/DevicesDetection/functions.php @@ -9,8 +9,10 @@ namespace Piwik\Plugins\DevicesDetection; -use DeviceDetector; use Piwik\Piwik; +use DeviceDetector\Parser\OperatingSystem AS OperatingSystemParser; +use DeviceDetector\Parser\Device\DeviceParserAbstract AS DeviceParser; +use DeviceDetector\Parser\Client\Browser AS BrowserParser; function getBrandLogo($label) { @@ -25,7 +27,7 @@ function getBrandLogo($label) function getBrowserFamilyFullNameExtended($label) { - foreach (DeviceDetector::$browserFamilies as $name => $family) { + foreach (BrowserParser::getAvailableBrowserFamilies() as $name => $family) { if (in_array($label, $family)) { return $name; } @@ -35,8 +37,9 @@ function getBrowserFamilyFullNameExtended($label) function getBrowserFamilyLogoExtended($label) { - if (array_key_exists($label, DeviceDetector::$browserFamilies)) { - return getBrowserLogoExtended(DeviceDetector::$browserFamilies[$label][0]); + $browserFamilies = BrowserParser::getAvailableBrowserFamilies(); + if (!empty($label) && array_key_exists($label, $browserFamilies)) { + return getBrowserLogoExtended($browserFamilies[$label][0]); } return getBrowserLogoExtended($label); } @@ -45,8 +48,9 @@ function getBrowserNameExtended($label) { $short = substr($label, 0, 2); $ver = substr($label, 3, 10); - if (array_key_exists($short, DeviceDetector::$browsers)) { - return trim(ucfirst(DeviceDetector::$browsers[$short]) . ' ' . $ver); + $browsers = BrowserParser::getAvailableBrowsers(); + if (array_key_exists($short, $browsers)) { + return trim(ucfirst($browsers[$short]) . ' ' . $ver); } else { return Piwik::translate('General_Unknown'); } @@ -70,8 +74,8 @@ function getBrowserLogoExtended($short) // If name is given instead of short code, try to find matching shortcode if (strlen($short) > 2) { - if (in_array($short, DeviceDetector::$browsers)) { - $flippedBrowsers = array_flip(DeviceDetector::$browsers); + if (in_array($short, BrowserParser::getAvailableBrowsers())) { + $flippedBrowsers = array_flip(BrowserParser::getAvailableBrowsers()); $short = $flippedBrowsers[$short]; } else { $short = substr($short, 0, 2); @@ -80,18 +84,27 @@ function getBrowserLogoExtended($short) $family = getBrowserFamilyFullNameExtended($short); - if (array_key_exists($short, DeviceDetector::$browsers) && file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, $short))) { + $browserFamilies = BrowserParser::getAvailableBrowserFamilies(); + + if (!empty($short) && + array_key_exists($short, BrowserParser::getAvailableBrowsers()) && + file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, $short))) { + return sprintf($path, $short); - } elseif (array_key_exists($family, DeviceDetector::$browserFamilies) && file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, DeviceDetector::$browserFamilies[$family][0]))) { - return sprintf($path, DeviceDetector::$browserFamilies[$family][0]); + + } elseif (!empty($short) && + array_key_exists($family, $browserFamilies) && + file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, $browserFamilies[$family][0]))) { + + return sprintf($path, $browserFamilies[$family][0]); } return sprintf($path, 'UNK'); } function getDeviceBrandLabel($label) { - if (array_key_exists($label, DeviceDetector::$deviceBrands)) { - return ucfirst(DeviceDetector::$deviceBrands[$label]); + if (array_key_exists($label, DeviceParser::$deviceBrands)) { + return ucfirst(DeviceParser::$deviceBrands[$label]); } else { return Piwik::translate('General_Unknown'); } @@ -110,8 +123,14 @@ function getDeviceTypeLabel($label) 'smart display' => 'DevicesDetection_SmartDisplay', 'camera' => 'DevicesDetection_Camera' ); - if (isset(DeviceDetector::$deviceTypes[$label]) && isset($translations[DeviceDetector::$deviceTypes[$label]])) { - return Piwik::translate($translations[DeviceDetector::$deviceTypes[$label]]); + + $deviceTypes = DeviceParser::getAvailableDeviceTypes(); + + if (is_numeric($label) && + in_array($label, $deviceTypes) && + isset($translations[array_search($label, $deviceTypes)])) { + + return Piwik::translate($translations[array_search($label, $deviceTypes)]); } else if (isset($translations[$label])) { return Piwik::translate($translations[$label]); } else { @@ -121,8 +140,8 @@ function getDeviceTypeLabel($label) function getDeviceTypeLogo($label) { - if (is_numeric($label) && isset(DeviceDetector::$deviceTypes[$label])) { - $label = DeviceDetector::$deviceTypes[$label]; + if (is_numeric($label) && in_array($label, DeviceParser::getAvailableDeviceTypes())) { + $label = array_search($label, DeviceParser::getAvailableDeviceTypes()); } $label = strtolower($label); @@ -156,7 +175,10 @@ function getModelName($label) function getOSFamilyFullNameExtended($label) { - $label = DeviceDetector::getOsFamily($label); + if ($label == \Piwik\Tracker\Settings::OS_BOT) { + return 'Bot'; + } + $label = OperatingSystemParser::getOsFamily($label); if($label !== false) { return $label; } @@ -165,18 +187,22 @@ function getOSFamilyFullNameExtended($label) function getOsFamilyLogoExtended($label) { - if (array_key_exists($label, DeviceDetector::$osFamilies)) { - return getOsLogoExtended(DeviceDetector::$osFamilies[$label][0]); + $osFamilies = OperatingSystemParser::getAvailableOperatingSystemFamilies(); + if (!empty($label) && array_key_exists($label, $osFamilies)) { + return getOsLogoExtended($osFamilies[$label][0]); } return getOsLogoExtended($label); } function getOsFullNameExtended($label) { + if (substr($label, 0, 3) == \Piwik\Tracker\Settings::OS_BOT) { + return 'Bot'; + } if (!empty($label) && $label != ";") { $os = substr($label, 0, 3); $ver = substr($label, 4, 15); - $name = DeviceDetector::getOsNameFromId($os, $ver); + $name = OperatingSystemParser::getNameFromId($os, $ver); if (!empty($name)) { return $name; } @@ -202,19 +228,27 @@ function getOsLogoExtended($short) // If name is given instead of short code, try to find matching shortcode if (strlen($short) > 3) { - if (array_key_exists($short, DeviceDetector::$osShorts)) { - $short = DeviceDetector::$osShorts[$short]; + if (in_array($short, OperatingSystemParser::getAvailableOperatingSystems())) { + $short = array_search($short, OperatingSystemParser::getAvailableOperatingSystems()); } else { $short = substr($short, 0, 3); } } $family = getOsFamilyFullNameExtended($short); + $osFamilies = OperatingSystemParser::getAvailableOperatingSystemFamilies(); + + if (!empty($short) && + array_key_exists($short, OperatingSystemParser::getAvailableOperatingSystems()) && + file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, $short))) { - if (in_array($short, DeviceDetector::$osShorts) && file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, $short))) { return sprintf($path, $short); - } elseif (array_key_exists($family, DeviceDetector::$osFamilies) && file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, DeviceDetector::$osFamilies[$family][0]))) { - return sprintf($path, DeviceDetector::$osFamilies[$family][0]); + + } elseif (!empty($family) && + array_key_exists($family, $osFamilies) && + file_exists(PIWIK_INCLUDE_PATH.'/'.sprintf($path, $osFamilies[$family][0]))) { + + return sprintf($path, $osFamilies[$family][0]); } return sprintf($path, 'UNK'); } diff --git a/plugins/Events/lang/bg.json b/plugins/Events/lang/bg.json index 5d62094f7f..54c4b959c4 100644 --- a/plugins/Events/lang/bg.json +++ b/plugins/Events/lang/bg.json @@ -1,5 +1,6 @@ { "Events": { + "AvgValue": "Средна стойност", "Event": "Събитие", "EventAction": "Действие на събитието", "EventCategory": "Категория на събитие", @@ -10,6 +11,8 @@ "MaxValueDocumentation": "Максималната стойност за това събитие", "MinValue": "Минимална стойност", "MinValueDocumentation": "Минималната стойност за това събитие", + "SecondaryDimension": "Второстепенното измерение е %s.", + "SwitchToSecondaryDimension": "Превключване към %s", "TopEvents": "Най-важните събития", "TotalEvents": "Общо събития", "TotalEventsDocumentation": "Общ брой събития", diff --git a/plugins/Events/lang/da.json b/plugins/Events/lang/da.json index a1f8b54c75..db8849014f 100644 --- a/plugins/Events/lang/da.json +++ b/plugins/Events/lang/da.json @@ -1,10 +1,31 @@ { "Events": { + "AvgEventValue": "Genomsnitlig værdi for hændelsen er: %s", + "AvgValue": "Gennemsnitsværdi", + "AvgValueDocumentation": "Gennemsnittet af alle værdier for denne hændelse", "Event": "Hændelse", "EventAction": "Hændelsesaktion", + "EventActions": "Hændelsesforløb", + "EventCategories": "Hændelseskategorier", "EventCategory": "Hændelseskategori", "EventName": "Hændelsesnavn", + "EventNames": "Hændelsesnavn", "Events": "Hændelser", - "EventValue": "Hændelsesværdi" + "EventsWithValue": "Hændelser med en værdi", + "EventsWithValueDocumentation": "Antal hændelser, hvor en hændelseværdi blev fastsat", + "EventValue": "Hændelsesværdi", + "EventValueTooltip": "Samlet hændelsesværdi er summen af %s hændelsesværdier %s mellem mindst %s og maksimalt %s.", + "MaxValue": "Max værdi", + "MaxValueDocumentation": "Den maksimale værdi for hændelsen", + "MinValue": "Min værdi", + "MinValueDocumentation": "Den mindste værdi for hændelsen", + "SecondaryDimension": "Sekundær dimension er %s.", + "SwitchToSecondaryDimension": "Skift til %s", + "TopEvents": "Tophændelser", + "TotalEvents": "Totale hændelser", + "TotalEventsDocumentation": "Total antal hændelser", + "TotalValue": "Total værdi", + "TotalValueDocumentation": "Summen af hændelserværdier", + "ViewEvents": "Vis hændelser" } }
\ No newline at end of file diff --git a/plugins/Events/lang/nl.json b/plugins/Events/lang/nl.json index 038730d299..f04206e860 100644 --- a/plugins/Events/lang/nl.json +++ b/plugins/Events/lang/nl.json @@ -16,6 +16,7 @@ "MaxValueDocumentation": "De maximale waarde voor deze gebeurtenis", "MinValue": "Minimale waarde", "MinValueDocumentation": "De minimale waarde voor deze gebeurtenis", + "SwitchToSecondaryDimension": "Omschakelen naar %s", "TopEvents": "Top Gebeurtenissen", "TotalEvents": "Totaal gebeurtenissen", "TotalEventsDocumentation": "Totaal aantal gebeurtenissen", diff --git a/plugins/ExampleAPI/API.php b/plugins/ExampleAPI/API.php index 27dc2f59aa..f7cb0424ce 100644 --- a/plugins/ExampleAPI/API.php +++ b/plugins/ExampleAPI/API.php @@ -28,6 +28,7 @@ class API extends \Piwik\Plugin\API public function getPiwikVersion() { Piwik::checkUserHasSomeViewAccess(); + Piwik::checkUserIsNotAnonymous(); return Version::VERSION; } diff --git a/plugins/ExamplePlugin/Widgets.php b/plugins/ExamplePlugin/Widgets.php index 6ce0c590dc..c213d91ee8 100644 --- a/plugins/ExamplePlugin/Widgets.php +++ b/plugins/ExamplePlugin/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/ExampleRssWidget/Widgets.php b/plugins/ExampleRssWidget/Widgets.php index 56444cd9c5..cd31ef95e0 100644 --- a/plugins/ExampleRssWidget/Widgets.php +++ b/plugins/ExampleRssWidget/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/Goals/Widgets.php b/plugins/Goals/Widgets.php index d7a90c9645..bdfa47a924 100644 --- a/plugins/Goals/Widgets.php +++ b/plugins/Goals/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/Insights/Widgets.php b/plugins/Insights/Widgets.php index 3c2f75f0b7..6ce632d8bc 100644 --- a/plugins/Insights/Widgets.php +++ b/plugins/Insights/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/Installation/Controller.php b/plugins/Installation/Controller.php index 377783f604..c0e7fd2be1 100644 --- a/plugins/Installation/Controller.php +++ b/plugins/Installation/Controller.php @@ -279,9 +279,9 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $form->getSubmitValue('email')); $email = $form->getSubmitValue('email'); - $newsletterSecurity = $form->getSubmitValue('subscribe_newsletter_security'); - $newsletterCommunity = $form->getSubmitValue('subscribe_newsletter_community'); - $this->registerNewsletter($email, $newsletterSecurity, $newsletterCommunity); + $newsletterPiwikORG = $form->getSubmitValue('subscribe_newsletter_piwikorg'); + $newsletterPiwikPRO = $form->getSubmitValue('subscribe_newsletter_piwikpro'); + $this->registerNewsletter($email, $newsletterPiwikORG, $newsletterPiwikPRO); $this->redirectToNextStep(__FUNCTION__); } catch (Exception $e) { @@ -625,6 +625,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin 'gzuncompress' => 'Installation_SystemCheckGzuncompressHelp', 'pack' => 'Installation_SystemCheckPackHelp', 'php5-json' => 'Installation_SystemCheckJsonHelp', + 'session.auto_start' => 'Installation_SystemCheckSessionAutostart', ); $view->problemWithSomeDirectories = (false !== array_search(false, $view->infos['directories'])); @@ -665,27 +666,27 @@ class Controller extends \Piwik\Plugin\ControllerAdmin /** * @param $email - * @param $newsletterSecurity - * @param $newsletterCommunity + * @param $newsletterPiwikORG + * @param $newsletterPiwikPRO */ - protected function registerNewsletter($email, $newsletterSecurity, $newsletterCommunity) + protected function registerNewsletter($email, $newsletterPiwikORG, $newsletterPiwikPRO) { $url = Config::getInstance()->General['api_service_url']; $url .= '/1.0/subscribeNewsletter/'; $params = array( 'email' => $email, - 'security' => $newsletterSecurity, - 'community' => $newsletterCommunity, + 'piwikorg' => $newsletterPiwikORG, + 'piwikpro' => $newsletterPiwikPRO, 'url' => Url::getCurrentUrlWithoutQueryString(), ); - if ($params['security'] == '1' - || $params['community'] == '1' + if ($params['piwikorg'] == '1' + || $params['piwikpro'] == '1' ) { - if (!isset($params['security'])) { - $params['security'] = '0'; + if (!isset($params['piwikorg'])) { + $params['piwikorg'] = '0'; } - if (!isset($params['community'])) { - $params['community'] = '0'; + if (!isset($params['piwikpro'])) { + $params['piwikpro'] = '0'; } $url .= '?' . http_build_query($params, '', '&'); try { diff --git a/plugins/Installation/FormSuperUser.php b/plugins/Installation/FormSuperUser.php index 68d9dcad14..aef40d6a40 100644 --- a/plugins/Installation/FormSuperUser.php +++ b/plugins/Installation/FormSuperUser.php @@ -53,21 +53,25 @@ class FormSuperUser extends QuickForm2 $email->addRule('required', Piwik::translate('General_Required', Piwik::translate('Installation_Email'))); $email->addRule('checkEmail', Piwik::translate('UsersManager_ExceptionInvalidEmail')); - $this->addElement('checkbox', 'subscribe_newsletter_security', null, array( - 'content' => ' ' . Piwik::translate('Installation_SecurityNewsletter'), - )); + $this->addElement('checkbox', 'subscribe_newsletter_piwikorg', null, + array( + 'content' => ' ' . Piwik::translate('Installation_PiwikOrgNewsletter'), + )); - $this->addElement('checkbox', 'subscribe_newsletter_community', null, array( - 'content' => ' ' . Piwik::translate('Installation_CommunityNewsletter'), - )); + $this->addElement('checkbox', 'subscribe_newsletter_piwikpro', null, + array( + 'content' => ' ' . Piwik::translate('Installation_PiwikProNewsletter', + array("<a href='http://piwik.pro' style='color:#444;' target='_blank'>", "</a>") + ), + )); $this->addElement('submit', 'submit', array('value' => Piwik::translate('General_Next') . ' »', 'class' => 'submit')); // default values $this->addDataSource(new HTML_QuickForm2_DataSource_Array(array( - 'subscribe_newsletter_community' => 1, - 'subscribe_newsletter_security' => 1, - ))); + 'subscribe_newsletter_piwikorg' => 1, + 'subscribe_newsletter_piwikpro' => 0, + ))); } } diff --git a/plugins/Installation/SystemCheck.php b/plugins/Installation/SystemCheck.php index 60585cf80a..c017a19d41 100644 --- a/plugins/Installation/SystemCheck.php +++ b/plugins/Installation/SystemCheck.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\Installation; +use Piwik\CliMulti; use Piwik\CliMulti\Process; use Piwik\Common; use Piwik\Config; @@ -59,7 +60,7 @@ class SystemCheck $infos['phpVersion_minimum'] = $piwik_minimumPHPVersion; $infos['phpVersion'] = PHP_VERSION; - $infos['phpVersion_ok'] = version_compare($piwik_minimumPHPVersion, $infos['phpVersion']) === -1; + $infos['phpVersion_ok'] = self::isPhpVersionValid($infos['phpVersion']); // critical errors $extensions = @get_loaded_extensions(); @@ -131,7 +132,6 @@ class SystemCheck 'parse_ini_file', 'glob', ); - $infos['desired_functions'] = $desired_functions; $infos['missing_desired_functions'] = array(); foreach ($desired_functions as $desired_function) { if (!self::functionExists($desired_function)) { @@ -139,11 +139,20 @@ class SystemCheck } } + $sessionAutoStarted = (int)ini_get('session.auto_start'); + if($sessionAutoStarted) { + $infos['missing_desired_functions'][] = 'session.auto_start'; + } + + $desired_settings = array( + 'session.auto_start', + ); + $infos['desired_functions'] = array_merge($desired_functions, $desired_settings); + $infos['openurl'] = Http::getTransportMethod(); $infos['gd_ok'] = SettingsServer::isGdExtensionEnabled(); - $serverSoftware = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : ''; $infos['serverVersion'] = addslashes($serverSoftware); $infos['serverOs'] = @php_uname(); @@ -174,7 +183,9 @@ class SystemCheck } $infos['timezone'] = SettingsServer::isTimezoneSupportEnabled(); - $infos['cli_process_ok'] = Process::isSupported(); + + $process = new CliMulti(); + $infos['cli_process_ok'] = $process->supportsAsync(); $infos['tracker_status'] = Common::getRequestVar('trackerStatus', 0, 'int'); @@ -182,6 +193,7 @@ class SystemCheck $infos['is_nfs'] = Filesystem::checkIfFileSystemIsNFS(); $infos = self::enrichSystemChecks($infos); + return $infos; } @@ -315,4 +327,15 @@ class SystemCheck ServerFilesGenerator::createWebRootFiles(); } + /** + * @param $piwik_minimumPHPVersion + * @param $infos + * @return bool + */ + public static function isPhpVersionValid($phpVersion) + { + global $piwik_minimumPHPVersion; + return version_compare($piwik_minimumPHPVersion, $phpVersion) === -1; + } + }
\ No newline at end of file diff --git a/plugins/LeftMenu/lang/bg.json b/plugins/LeftMenu/lang/bg.json new file mode 100644 index 0000000000..4c5cc8fc36 --- /dev/null +++ b/plugins/LeftMenu/lang/bg.json @@ -0,0 +1,5 @@ +{ + "LeftMenu": { + "UserSettingTitle": "Активиране на лявото меню за отчет" + } +}
\ No newline at end of file diff --git a/plugins/LeftMenu/lang/da.json b/plugins/LeftMenu/lang/da.json new file mode 100644 index 0000000000..537645be76 --- /dev/null +++ b/plugins/LeftMenu/lang/da.json @@ -0,0 +1,10 @@ +{ + "LeftMenu": { + "GlobalSettingDescription": "Definerer systemets standard indstillinger for alle brugerne.", + "GlobalSettingInlineHelp": "Brugerne er i stand til at aktivere\/deaktivere venstremenuen uafhængigt af systemets standard indstillinger.", + "GlobalSettingTitle": "Venstre menu aktiveret som standard", + "SettingsIntroduction": "Venstre menu udvidelsen vil flytte rapportmenuen fra toppen til venstre, hvis aktiveret. Dette er især nyttigt for store skærme.", + "UserSettingInlineHelp": "Dette vil kun aktivere eller deaktivere venstre menuen for dig og påvirker ikke andre brugere. En superbruger kan ændre standardindstillingen for alle brugere.", + "UserSettingTitle": "Aktiver rapportmenu til venstre" + } +}
\ No newline at end of file diff --git a/plugins/LeftMenu/lang/el.json b/plugins/LeftMenu/lang/el.json new file mode 100644 index 0000000000..1c8989026f --- /dev/null +++ b/plugins/LeftMenu/lang/el.json @@ -0,0 +1,10 @@ +{ + "LeftMenu": { + "GlobalSettingDescription": "Ορίζει την προεπιλογή για όλους τους χρήστες.", + "GlobalSettingInlineHelp": "Οι χρήστες μπορούν να απενεργοποιούν\/ενεργοποιούν το αριστερό μενού ανεξάρτητα από την προεπιλεγμένη ρύθμιση του συστήματος.", + "GlobalSettingTitle": "Το αριστερό μενού είναι εξ' ορισμού ενεργοποιημένο.", + "SettingsIntroduction": "Το πρόσθετο για το αριστερό μενού θα μετακινήσει το μενού αναφορών από την κορυφή προς τα αριστερά αν ενεργοποιηθεί. Αυτό είναι ιδιαίτερα χρήσιμο για μεγάλες οθόνες.", + "UserSettingInlineHelp": "Αυτό θα ενεργοποιήσει ή απενεργοποιήσει το αριστερό μενού μόνο για εσάς και δε θα επηρεάσει άλλους χρήστες. Ένας Υπερχρήστης μπορεί να αλλάξει την προκαθορισμένη ρύθμιση για όλους τους χρήστες.", + "UserSettingTitle": "Ενεργοποίηση του αριστερού μενού αναφορών" + } +}
\ No newline at end of file diff --git a/plugins/LeftMenu/lang/it.json b/plugins/LeftMenu/lang/it.json new file mode 100644 index 0000000000..0b305449d9 --- /dev/null +++ b/plugins/LeftMenu/lang/it.json @@ -0,0 +1,10 @@ +{ + "LeftMenu": { + "GlobalSettingDescription": "Definisce le impostazioni predefinite di sistema per tutti gli utenti.", + "GlobalSettingInlineHelp": "Gli utenti possono disabilitare o abilitare il menù di sinistra indipendentemente dalle impostazioni predefinite del sistema.", + "GlobalSettingTitle": "Il menù di sinistra è abilitato di default", + "SettingsIntroduction": "Il plugin menù di sinistra sposta il menu di segnalazione dalla parte superiore a sinistra, se abilitato. Ciò è particolarmente utile per i display di grandi dimensioni.", + "UserSettingInlineHelp": "Questo abilita o disabilita il menù di sinistra solo per te e non ha effetto per gli altri utenti. Un Super User può cambiare per tutti gli utenti le impostazioni predefinite.", + "UserSettingTitle": "Abilita il menù di segnalazione di sinistra" + } +}
\ No newline at end of file diff --git a/plugins/LeftMenu/lang/nl.json b/plugins/LeftMenu/lang/nl.json new file mode 100644 index 0000000000..e0fa59a255 --- /dev/null +++ b/plugins/LeftMenu/lang/nl.json @@ -0,0 +1,6 @@ +{ + "LeftMenu": { + "GlobalSettingDescription": "Definieert het systeem standaard voor al uw gebruikers.", + "GlobalSettingTitle": "Linker menu standaard ingeschakeld" + } +}
\ No newline at end of file diff --git a/plugins/Live/Widgets.php b/plugins/Live/Widgets.php index bb07f55397..c216a54841 100644 --- a/plugins/Live/Widgets.php +++ b/plugins/Live/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/PrivacyManager/DoNotTrackHeaderChecker.php b/plugins/PrivacyManager/DoNotTrackHeaderChecker.php index 93c0e79fca..5ee5642fdd 100644 --- a/plugins/PrivacyManager/DoNotTrackHeaderChecker.php +++ b/plugins/PrivacyManager/DoNotTrackHeaderChecker.php @@ -37,9 +37,9 @@ class DoNotTrackHeaderChecker ) { $request = new Request($_REQUEST); $ua = $request->getUserAgent(); - if (strpos($ua, 'MSIE 10') !== false - || strpos($ua, 'Trident/7') !== false) { - Common::printDebug("INTERNET EXPLORER 10 and 11 enable DoNotTrack by default; so Piwik ignores DNT for all IE10 + IE11 browsers..."); + if (strpos($ua, 'MSIE') !== false + || strpos($ua, 'Trident') !== false) { + Common::printDebug("INTERNET EXPLORER enable DoNotTrack by default; so Piwik ignores DNT IE browsers..."); return; } diff --git a/plugins/Referrers/Widgets.php b/plugins/Referrers/Widgets.php index f1e78ac783..0a565ddb8c 100644 --- a/plugins/Referrers/Widgets.php +++ b/plugins/Referrers/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/SEO/Widgets.php b/plugins/SEO/Widgets.php index 9e65a0185c..969c918eb3 100644 --- a/plugins/SEO/Widgets.php +++ b/plugins/SEO/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php b/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php index 3e9b51488b..b7df996637 100755 --- a/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php +++ b/plugins/UserCountry/LocationProvider/GeoIp/ServerBased.php @@ -28,6 +28,7 @@ class ServerBased extends GeoIp const TITLE = 'GeoIP (%s)'; const TEST_SERVER_VAR = 'GEOIP_ADDR'; const TEST_SERVER_VAR_ALT = 'GEOIP_COUNTRY_CODE'; + const TEST_SERVER_VAR_ALT_IPV6 = 'GEOIP_COUNTRY_CODE_V6'; private static $geoIpServerVars = array( parent::COUNTRY_CODE_KEY => 'GEOIP_COUNTRY_CODE', @@ -96,6 +97,11 @@ class ServerBased extends GeoIp if (!empty($_SERVER[$geoipVarName])) { $result[$resultKey] = $_SERVER[$geoipVarName]; } + + $geoipVarNameV6 = $geoipVarName . '_V6'; + if (!empty($_SERVER[$geoipVarNameV6])) { + $result[$resultKey] = $_SERVER[$geoipVarNameV6]; + } } foreach (self::$geoIpUtfServerVars as $resultKey => $geoipVarName) { if (!empty($_SERVER[$geoipVarName])) { @@ -150,25 +156,27 @@ class ServerBased extends GeoIp } $available = !empty($_SERVER[self::TEST_SERVER_VAR]) - || !empty($_SERVER[self::TEST_SERVER_VAR_ALT]); + || !empty($_SERVER[self::TEST_SERVER_VAR_ALT]) + || !empty($_SERVER[self::TEST_SERVER_VAR_ALT_IPV6]) + ; if ($available) { return true; - } else // if not available return message w/ extra info - { - if (!function_exists('apache_get_modules')) { - return Piwik::translate('General_Note') . ': ' . Piwik::translate('UserCountry_AssumingNonApache'); - } + } - $message = "<strong><em>" . Piwik::translate('General_Note') . ': ' - . Piwik::translate('UserCountry_FoundApacheModules') - . "</em></strong>:<br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n"; - foreach (apache_get_modules() as $name) { - $message .= "<li>$name</li>\n"; - } - $message .= "</ul>"; - return $message; + // if not available return message w/ extra info + if (!function_exists('apache_get_modules')) { + return Piwik::translate('General_Note') . ': ' . Piwik::translate('UserCountry_AssumingNonApache'); + } + + $message = "<strong><em>" . Piwik::translate('General_Note') . ': ' + . Piwik::translate('UserCountry_FoundApacheModules') + . "</em></strong>:<br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n"; + foreach (apache_get_modules() as $name) { + $message .= "<li>$name</li>\n"; } + $message .= "</ul>"; + return $message; } /** @@ -180,6 +188,7 @@ class ServerBased extends GeoIp { if (empty($_SERVER[self::TEST_SERVER_VAR]) && empty($_SERVER[self::TEST_SERVER_VAR_ALT]) + && empty($_SERVER[self::TEST_SERVER_VAR_ALT_IPV6]) ) { return Piwik::translate("UserCountry_CannotFindGeoIPServerVar", self::TEST_SERVER_VAR . ' $_SERVER'); } diff --git a/plugins/VisitFrequency/Widgets.php b/plugins/VisitFrequency/Widgets.php index cea4a4348d..1b132c9f45 100644 --- a/plugins/VisitFrequency/Widgets.php +++ b/plugins/VisitFrequency/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later diff --git a/plugins/VisitsSummary/Widgets.php b/plugins/VisitsSummary/Widgets.php index b51d855106..3e1b5cfbfe 100644 --- a/plugins/VisitsSummary/Widgets.php +++ b/plugins/VisitsSummary/Widgets.php @@ -1,6 +1,6 @@ <?php /** - * Piwik - Open source web analytics + * Piwik - free/libre analytics platform * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |