diff --git a/core/AssetManager.php b/core/AssetManager.php index b5ae6a6a5fb86d903b850db542e45683cf53f7cf..c3c3101762cb2e301efa7a513443aa74e9c6ed39 100644 --- a/core/AssetManager.php +++ b/core/AssetManager.php @@ -46,6 +46,8 @@ class AssetManager const CSS_IMPORT_EVENT = "AssetManager.getStylesheetFiles"; const JS_IMPORT_EVENT = "AssetManager.getJsFiles"; const MERGED_FILE_DIR = "tmp/assets/"; + const COMPRESSED_FILE_LOCATION = "/tmp/assets/"; + const CSS_IMPORT_DIRECTIVE = "<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\" />\n"; const JS_IMPORT_DIRECTIVE = "<script type=\"text/javascript\" src=\"%s\"></script>\n"; const GET_CSS_MODULE_ACTION = "index.php?module=Proxy&action=getCss"; @@ -500,8 +502,9 @@ class AssetManager } // Tries to remove compressed version of the merged file. - // See Piwik::serverStaticFile() for more info on static file compression - $compressedFileLocation = PIWIK_USER_PATH . Piwik::COMPRESSED_FILE_LOCATION . $filename; + // See ProxyHttp::serverStaticFile() for more info on static file compression + $compressedFileLocation = PIWIK_USER_PATH . self::COMPRESSED_FILE_LOCATION . $filename; + $compressedFileLocation = SettingsPiwik::rewriteTmpPathWithHostname($compressedFileLocation); @unlink($compressedFileLocation . ".deflate"); @unlink($compressedFileLocation . ".gz"); @@ -538,6 +541,7 @@ class AssetManager private static function getMergedFileDirectory() { $mergedFileDirectory = PIWIK_USER_PATH . '/' . self::MERGED_FILE_DIR; + $mergedFileDirectory = SettingsPiwik::rewriteTmpPathWithHostname($mergedFileDirectory); if (!is_dir($mergedFileDirectory)) { Filesystem::mkdir($mergedFileDirectory); diff --git a/core/CacheFile.php b/core/CacheFile.php index 139beeaffc5c71f96b76552239f0b448156b90e1..9ee78168f5aca03d78321aefbf7b81ff27370cef 100644 --- a/core/CacheFile.php +++ b/core/CacheFile.php @@ -48,7 +48,9 @@ class CacheFile */ public function __construct($directory, $timeToLiveInSeconds = 300) { - $this->cachePath = PIWIK_USER_PATH . '/tmp/cache/' . $directory . '/'; + $cachePath = PIWIK_USER_PATH . '/tmp/cache/' . $directory . '/'; + $this->cachePath = SettingsPiwik::rewriteTmpPathWithHostname($cachePath); + if ($timeToLiveInSeconds < self::MINIMUM_TTL) { $timeToLiveInSeconds = self::MINIMUM_TTL; } diff --git a/core/Config.php b/core/Config.php index d88709379a69177575fca7b8c6d1e773a6ec6998..c7536ac338966e1580f783bd91e9d2a754a08332 100644 --- a/core/Config.php +++ b/core/Config.php @@ -155,9 +155,41 @@ class Config */ public static function getLocalConfigPath() { + $path = self::getByDomainConfigPath(); + if($path) { + return $path; + } + return PIWIK_USER_PATH . '/config/config.ini.php'; } + public function getConfigHostnameIfSet() + { + if($this->getByDomainConfigPath() === false) { + return false; + } + return $this->getHostname(); + } + + protected static function getByDomainConfigPath() + { + $host = self::getHostname(); + $perHostFilename = $host . '.config.ini.php'; + $pathDomainConfig = PIWIK_USER_PATH . '/config/' . $perHostFilename; + if (Filesystem::isValidFilename($perHostFilename) + && file_exists($pathDomainConfig) + ) { + return $pathDomainConfig; + } + return false; + } + + protected static function getHostname() + { + $host = Url::getHost($checkIfTrusted = false); // Check trusted requires config file which is not ready yet + return $host; + } + /** * Is local configuration file writable? * diff --git a/core/Db/BatchInsert.php b/core/Db/BatchInsert.php index 019cd4d51c9131cbc87620218e73fd6d797486a7..cd339e215eb647a084fa72dcc8af087aba22c408 100644 --- a/core/Db/BatchInsert.php +++ b/core/Db/BatchInsert.php @@ -17,6 +17,7 @@ use Piwik\Config; use Piwik\Db; use Piwik\DbHelper; use Piwik\Piwik; +use Piwik\SettingsPiwik; use Piwik\SettingsServer; class BatchInsert @@ -60,6 +61,7 @@ class BatchInsert public static function tableInsertBatch($tableName, $fields, $values, $throwException = false) { $filePath = PIWIK_USER_PATH . '/' . AssetManager::MERGED_FILE_DIR . $tableName . '-' . Common::generateUniqId() . '.csv'; + $filePath = SettingsPiwik::rewriteTmpPathWithHostname($filePath); if (Db::get()->hasBulkLoader()) { try { diff --git a/core/ExceptionHandler.php b/core/ExceptionHandler.php index 081e4601a871d0c2f5d4e41e8f96ff8931251155..26ecef6a00ce99b658099ef82968493bd78758d9 100644 --- a/core/ExceptionHandler.php +++ b/core/ExceptionHandler.php @@ -10,12 +10,8 @@ */ namespace Piwik; -use Piwik\Common; -use Piwik\Piwik; -use Piwik\Plugin; -use Piwik\Log; -use Piwik\FrontController; use Piwik\API\ResponseBuilder; +use Piwik\Plugin; /** * Contains Piwik's uncaught exception handler and log file formatting for exception @@ -62,7 +58,7 @@ class ExceptionHandler } } - public static function exceptionHandler(Exception $exception) + public static function exceptionHandler(\Exception $exception) { Log::error($exception); } diff --git a/core/Filechecks.php b/core/Filechecks.php index 1c15cc5ea864511d45173421b36c6469abd336b0..893e158d62c86fbaf87aebf206e946d5d53b447c 100644 --- a/core/Filechecks.php +++ b/core/Filechecks.php @@ -40,10 +40,13 @@ class Filechecks { $resultCheck = array(); foreach ($directoriesToCheck as $directoryToCheck) { + if (!preg_match('/^' . preg_quote(PIWIK_USER_PATH, '/') . '/', $directoryToCheck)) { $directoryToCheck = PIWIK_USER_PATH . $directoryToCheck; } + $directoryToCheck = SettingsPiwik::rewriteTmpPathWithHostname($directoryToCheck); + // Create an empty directory $isFile = strpos($directoryToCheck, '.') !== false; if (!$isFile && !file_exists($directoryToCheck)) { diff --git a/core/Filesystem.php b/core/Filesystem.php index 51bdc5fee83a7cccd890d15fc4aedf464ab1a7f4..5c7ea6d86896a6645b442a7a5df8a1d25842ff90 100644 --- a/core/Filesystem.php +++ b/core/Filesystem.php @@ -194,7 +194,7 @@ class Filesystem * @param boolean $deleteRootToo Delete specified top-level directory as well * @param Closure|false $beforeUnlink A closure to execute before unlinking. */ - public static function unlinkRecursive($dir, $deleteRootToo, $beforeUnlink = false) + public static function unlinkRecursive($dir, $deleteRootToo, \Closure $beforeUnlink = null) { if (!$dh = @opendir($dir)) { return; diff --git a/core/Log.php b/core/Log.php index 06755e41def8b443c52254907a01ff624615a57c..f3e566c12d6b25846d391bf815ddf03ede2ea127 100644 --- a/core/Log.php +++ b/core/Log.php @@ -290,7 +290,8 @@ class Log if (is_dir($logPath)) { $logPath .= '/piwik.log'; } - $this->logToFilePath = $logPath; + + $this->logToFilePath = SettingsPiwik::rewriteTmpPathWithHostname($logPath); } private function createWriterByName($writerName) diff --git a/core/Piwik.php b/core/Piwik.php index 0d33e42a06a7e717fcd7e67cd00144900a415c5f..4977cb1dad07c6574006cbb294eda0d2e36358f3 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -34,8 +34,6 @@ require_once PIWIK_INCLUDE_PATH . '/core/Translate.php'; */ class Piwik { - const COMPRESSED_FILE_LOCATION = '/tmp/assets/'; - /** * Piwik periods * @var array diff --git a/core/ProxyHttp.php b/core/ProxyHttp.php index 5bcde43de1dbc0f591f0e3ce4bdd546799cd8ff1..030443d801ee14cc808875af3751590de9fd0198 100644 --- a/core/ProxyHttp.php +++ b/core/ProxyHttp.php @@ -91,7 +91,8 @@ class ProxyHttp // optional compression $compressed = false; $encoding = ''; - $compressedFileLocation = PIWIK_USER_PATH . Piwik::COMPRESSED_FILE_LOCATION . basename($file); + $compressedFileLocation = PIWIK_USER_PATH . AssetManager::COMPRESSED_FILE_LOCATION . basename($file); + $compressedFileLocation = SettingsPiwik::rewriteTmpPathWithHostname($compressedFileLocation); $phpOutputCompressionEnabled = ProxyHttp::isPhpOutputCompressed(); if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && !$phpOutputCompressionEnabled) { diff --git a/core/ReportRenderer.php b/core/ReportRenderer.php index 3287a6e97ee8a5b960f4bb91fd4e5b38b9f7beaa..18ac8f9c51a8db6ba0a1b9f2a588046f0508410a 100644 --- a/core/ReportRenderer.php +++ b/core/ReportRenderer.php @@ -147,6 +147,8 @@ abstract class ReportRenderer protected static function getOutputPath($filename) { $outputFilename = PIWIK_USER_PATH . '/tmp/assets/' . $filename; + $outputFilename = SettingsPiwik::rewriteTmpPathWithHostname($outputFilename); + @chmod($outputFilename, 0600); @unlink($outputFilename); return $outputFilename; diff --git a/core/Session.php b/core/Session.php index 221c62bac21a9f779ca125de5d563ce7e5effb16..5f3c765a7ac500c221459b3b714b7c6ed3c93213 100644 --- a/core/Session.php +++ b/core/Session.php @@ -128,9 +128,11 @@ class Session extends Zend_Session we recommend that you <a href='http://piwik.org/faq/how-to-install/#faq_133' target='_blank'>enable database session storage</a>."; } + $pathToSessions = Filechecks::getErrorMessageMissingPermissions(Filesystem::getPathToPiwikRoot() . '/tmp/sessions/'); + $pathToSessions = SettingsPiwik::rewriteTmpPathWithHostname($pathToSessions); $message = sprintf("Error: %s %s %s\n<pre>Debug: the original error was \n%s</pre>", Piwik_Translate('General_ExceptionUnableToStartSession'), - Filechecks::getErrorMessageMissingPermissions(Filesystem::getPathToPiwikRoot() . '/tmp/sessions/'), + $pathToSessions, $enableDbSessions, $e->getMessage() ); @@ -146,6 +148,7 @@ class Session extends Zend_Session */ public static function getSessionsDirectory() { + //tmp return PIWIK_USER_PATH . '/tmp/sessions'; } } diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php index 19e92338911e143a64dc99467865ccbd78833832..51e7c006a85fe2bd567cf25036899a61019050d5 100644 --- a/core/SettingsPiwik.php +++ b/core/SettingsPiwik.php @@ -166,4 +166,30 @@ class SettingsPiwik return $result; } + + /** + * If Piwik uses per-domain config file, also make tmp/ folder per-domain + * @param $path + * @return string + * @throws \Exception + */ + public static function rewriteTmpPathWithHostname($path) + { + $configByHost = Config::getInstance()->getConfigHostnameIfSet(); + if(empty($configByHost)) { + return $path; + } + + $tmp = '/tmp/'; + if(($posTmp = strrpos($path, $tmp)) === false) { + throw new Exception("The path $path was expected to contain the string /tmp/ "); + } + + $tmpToReplace = $tmp . $configByHost . '/'; + + // replace only the latest occurrence (in case path contains twice /tmp) + $path = substr_replace($path, $tmpToReplace, $posTmp, strlen($tmp)); + + return $path; + } } diff --git a/core/Twig.php b/core/Twig.php index 59fabb8a2ecb4ab860051c9137bac52e5242314f..0520d242d7f43891727407d8e0de1592c3c9ceba 100644 --- a/core/Twig.php +++ b/core/Twig.php @@ -46,11 +46,14 @@ class Twig $chainLoader = new Twig_Loader_Chain(array($loader)); // Create new Twig Environment and set cache dir + $templatesCompiledPath = PIWIK_USER_PATH . '/tmp/templates_c'; + $templatesCompiledPath = SettingsPiwik::rewriteTmpPathWithHostname($templatesCompiledPath); + $this->twig = new Twig_Environment($chainLoader, array( 'debug' => true, // to use {{ dump(var) }} in twig templates 'strict_variables' => true, // throw an exception if variables are invalid - 'cache' => PIWIK_USER_PATH . '/tmp/templates_c', + 'cache' => $templatesCompiledPath, ) ); $this->twig->addExtension(new Twig_Extension_Debug()); diff --git a/core/functions.php b/core/functions.php index c706a17b6a9cd5bf8dbeea4306751313dfcd0fd0..a34fdca893000be1c21359e5ac10d311b834a6eb 100644 --- a/core/functions.php +++ b/core/functions.php @@ -262,8 +262,7 @@ namespace { // Bridge between pre Piwik2 serialized format and namespaced classes // Do not need to define these classes in tracker or archive - if(empty($GLOBALS['PIWIK_TRACKER_MODE']) - && !defined('PIWIK_MODE_ARCHIVE')) { + if(class_exists('\\Piwik\\DataTable\\Row\\DataTableSummaryRow')) { class Piwik_DataTable_Row_DataTableSummary extends \Piwik\DataTable\Row\DataTableSummaryRow { } diff --git a/js/index.php b/js/index.php index 5d8ec0a41b4bb713ea4f8e341eed27a24c89727d..b47cc5c2f3f2fb90868e5dc7dab235964d55c6c8 100644 --- a/js/index.php +++ b/js/index.php @@ -25,8 +25,8 @@ define('PIWIK_DOCUMENT_ROOT', '..'); define('PIWIK_USER_PATH', '..'); require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php'; -require_once PIWIK_INCLUDE_PATH . '/core/Piwik.php'; -require_once PIWIK_INCLUDE_PATH . '/core/ProxyHttp.php'; +require_once PIWIK_INCLUDE_PATH . '/core/functions.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Loader.php'; $file = '../piwik.js'; diff --git a/lang/ar.json b/lang/ar.json index 8a72d686254417347fbe692ff581f2cf6e9ffc3a..dc5f43d60abde51fa907ab323cea623b32d4688c 100644 --- a/lang/ar.json +++ b/lang/ar.json @@ -125,7 +125,6 @@ "LogoNotWriteable": "لاستخدام شعار مخصص، ستØتاج إلى صلاØيات الكتابة على ملÙات الشعار ÙÙŠ مجلد القالب: %s", "LogoUpload": "اختر شعاراً لرÙعه", "LogoUploadDescription": "الرجاء رÙع مل٠بصيغة %sØŒ بدون خلÙيات Ø´ÙاÙØ© بارتÙاع لا يقل عن %s بكسل.", - "MenuCommunity": "المجتمع", "MenuDiagnostic": "التشخيص", "MenuGeneralSettings": "الإعدادات العامة", "MenuManage": "الإدارة", diff --git a/lang/bg.json b/lang/bg.json index 6ba9bec0c3f6a872230709020b1231f280816708..29a4868f34b8649d7fce98a81e33517d628daeb3 100644 --- a/lang/bg.json +++ b/lang/bg.json @@ -108,7 +108,6 @@ "LogoNotWriteable": "За да използвате изработеното лого Piwik изиÑква пиÑмен доÑтъп до файловете на логото в тематичната директориÑ: %s", "LogoUpload": "Изберете логото за качване", "LogoUploadDescription": "ÐœÐ¾Ð»Ñ ÐºÐ°Ñ‡Ð²Ð°Ð¹Ñ‚Ðµ файла в %s формати, без прозрачни фонове, Ñ Ð¼Ð¸Ð½Ð¸Ð¼Ð°Ð»Ð½Ð° виÑочина от %s пикÑела.", - "MenuCommunity": "ОбщноÑÑ‚", "MenuDiagnostic": "ДиагноÑтика", "MenuGeneralSettings": "ОÑновни наÑтройки", "MenuManage": "Управление", diff --git a/lang/cs.json b/lang/cs.json index ec8897ae6f67bf08de9f5f218f4b4a22b4750527..46e6ec7c8917d6024138d2fc09eed5e9b987d444 100644 --- a/lang/cs.json +++ b/lang/cs.json @@ -97,7 +97,6 @@ "LatestStableRelease": "Poslednà stabilnà verze", "LogoUpload": "Vyberte logotyp", "LogoUploadDescription": "ProsÃm nahrajte soubor ve formátu %s bez transparentnÃho pozadà s minimálnà výškou %s pixelů.", - "MenuCommunity": "Komunita", "MenuDiagnostic": "Diagnostika", "MenuGeneralSettings": "Hlavnà nastavenÃ", "MenuManage": "Správa", diff --git a/lang/da.json b/lang/da.json index fb875862bf46e17bad2d790f5d6f5148600f6f87..f44d1cdcbac82bdfb5ad78c68b75d857363f39ae 100644 --- a/lang/da.json +++ b/lang/da.json @@ -142,7 +142,6 @@ "LogoNotWriteable": "For at anvende et brugerdefineret logo, kræver Piwik skrive adgang til logofilerne i skabelonmappen: %s", "LogoUpload": "Vælg et logo til overførelse", "LogoUploadDescription": "Overfør en fil i formatet %s, ingen gennemsigtig baggrund og med en højde pÃ¥ minimum %s pixels.", - "MenuCommunity": "Fællesskab", "MenuDiagnostic": "Diagnosticering", "MenuGeneralSettings": "Generelle indstillinger", "MenuManage": "Administrere", diff --git a/lang/de.json b/lang/de.json index 5a8c34164722d5f09d6e7ca911d9c44ca3c6bd85..7df9f42be59e5dd48775d79f03b180c3c7095e0b 100644 --- a/lang/de.json +++ b/lang/de.json @@ -144,7 +144,6 @@ "LogoNotWriteable": "Um ein eigenes Logo in Piwik verwenden zu können, wird Schreibzugriff auf die Logo Dateien im themes Ordner benötigt: %s", "LogoUpload": "Wählen Sie ein Logo für den Upload", "LogoUploadDescription": "Es werden Logos in %s Formaten, ohne Transparenz und mit einer minimalen Höhe von %s Pixeln unterstützt.", - "MenuCommunity": "Community", "MenuDiagnostic": "Diagnose", "MenuGeneralSettings": "Allgemeine Einstellungen", "MenuManage": "Verwalten", diff --git a/lang/el.json b/lang/el.json index dd70ec246c1e794db5ba9bf6c2d3204346f1902c..3c4c014a5424e0e6d4c883d6d001340082c32058 100644 --- a/lang/el.json +++ b/lang/el.json @@ -141,7 +141,6 @@ "LogoNotWriteable": "Για να χÏησιμοποιήσετε Îνα Ï€ÏοσαÏμοσμÎνο υπόβαθÏο, το Piwik απαιτεί δικαιώματα εγγÏαφής στα αÏχεία λογοτÏπου μÎσα στο φάκελο των θεμάτων: %s", "LogoUpload": "ΕπιλÎξτε Îνα Λογότυπο για αποστολή", "LogoUploadDescription": "Αποστείλτε Îνα αÏχείο σε μοÏφÎÏ‚ %s, χωÏίς διάφανο υπόβαθÏο, με ελάχιστο Ïψος %s εικονοστοιχεία (pixels).", - "MenuCommunity": "Κοινότητα", "MenuDiagnostic": "Διαγνωστικά", "MenuGeneralSettings": "ΓενικÎÏ‚ Ïυθμίσεις", "MenuManage": "ΔιαχείÏιση", diff --git a/lang/en.json b/lang/en.json index 10e45ba7b9d4439c7fc05dd935be843654a0b588..e38b5048e2afe4a0bb2d5f335e935b8f7ed55934 100644 --- a/lang/en.json +++ b/lang/en.json @@ -508,7 +508,6 @@ }, "CoreAdminHome": { "PluginDescription": "Administration area of Piwik.", - "MenuCommunity": "Community", "MenuDiagnostic": "Diagnostic", "MenuGeneralSettings": "General settings", "MenuManage": "Manage", diff --git a/lang/es.json b/lang/es.json index c972526af10f6acf72eb73d90eeb20e3130ebb71..80c718203b6f2f9a661c34478f115d663cd854e4 100644 --- a/lang/es.json +++ b/lang/es.json @@ -119,7 +119,6 @@ "LogoNotWriteable": "Para usar un logo personalizado Piwik necesita acceso de escritura a los archivos de logo en el directorio de temas: %s", "LogoUpload": "Seleccione un logo para subir", "LogoUploadDescription": "Por favor suba un archivo en %s formatos, sin transparencias, con una altura mÃnima de %s pÃxeles.", - "MenuCommunity": "comunidad", "MenuDiagnostic": "diagnóstico", "MenuGeneralSettings": "Configuración General", "MenuManage": "gestionar", diff --git a/lang/fa.json b/lang/fa.json index 4a2ded6945fd0b07c8be1acfb2ea896c527608e9..f701b4d4ea3502d5f3156dab3b967284d49c6c38 100644 --- a/lang/fa.json +++ b/lang/fa.json @@ -122,7 +122,6 @@ "LatestStableRelease": "آخرین نسخه نهایی", "LogoNotWriteable": "برای استÙاده از یک آرم سÙارشی پیویک به دسترسی نوشتن به Ùایل های آرم نیاز دارد Ú©Ù‡ در پوشه ÛŒ پوسته ها است: %s", "LogoUpload": "انتخاب آرم برای آپلود", - "MenuCommunity": "انجمن", "MenuDiagnostic": "برشناختی", "MenuGeneralSettings": "تنضیمات اصلی", "MenuManage": "مدیریت", diff --git a/lang/fr.json b/lang/fr.json index e593804035df2e9f87075efcd0b9478aef6beb45..ac4cd850a9b6d798bd5c733b7ebe372f25ee9263 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -142,7 +142,6 @@ "LogoNotWriteable": "Pour utiliser un logo personnalisé Piwik a besoin d'un accès en écriture aux fichiers de logo dans les répertoires des thèmes: %s", "LogoUpload": "Sélectionnez le logo à télécharger", "LogoUploadDescription": "Veuillez télécharger un fichier dans un de ces formats %s, sans fond transparent et avec une hauteur minimale de %s pixels.", - "MenuCommunity": "Communauté", "MenuDiagnostic": "Diagnostique", "MenuGeneralSettings": "Paramètres généraux", "MenuManage": "Gérer", diff --git a/lang/he.json b/lang/he.json index eff8268d6b4d04a1de975f49cd81b017b1e8d527..c7c48fed145c39a352c21c98cd3266295a2e4e2e 100644 --- a/lang/he.json +++ b/lang/he.json @@ -65,7 +65,6 @@ "ImageTracking": "×ª×ž×•× ×ª מעקב", "LatestBetaRelease": "גרסת × ×¡×™×•×Ÿ ××—×¨×•× ×”", "LogoUpload": "בחירת קובץ לוגו", - "MenuCommunity": "קהילה", "MenuDiagnostic": "×בחון", "MenuGeneralSettings": "הגדרות כלליות", "MenuManage": "× ×™×”×•×œ", diff --git a/lang/hi.json b/lang/hi.json index a5d8b63a4f347c381e66c0c3c05c3d97d04e56a0..c8a37d292e7c8da4f692b46b00bb0518270f1e17 100644 --- a/lang/hi.json +++ b/lang/hi.json @@ -140,7 +140,6 @@ "LogoNotWriteable": "à¤à¤• कसà¥à¤Ÿà¤® पà¥à¤°à¤¤à¥€à¤• चिनà¥â€à¤¹ Piwik उपयोग करने के लिठविषयों निरà¥à¤¦à¥‡à¤¶à¤¿à¤•à¤¾ के à¤à¥€à¤¤à¤° पà¥à¤°à¤¤à¥€à¤• चिनà¥â€à¤¹ फाइल करने के लिठउपयोग लिखने की आवशà¥à¤¯à¤•à¤¤à¤¾ है: %s", "LogoUpload": "अपलोड करने के लिठकिसी लोगो को चà¥à¤¨à¥‡à¤‚", "LogoUploadDescription": "%s पिकà¥à¤¸à¤² के à¤à¤• नà¥à¤¯à¥‚नतम ऊंचाई के साथ %s पà¥à¤°à¤¾à¤°à¥‚प में à¤à¤• फ़ाइल, कोई पारदरà¥à¤¶à¥€ पृषà¥à¤ à¤à¥‚मि, अपलोड करें.", - "MenuCommunity": "समà¥à¤ªà¥à¤°à¤¦à¤¾à¤¯", "MenuDiagnostic": "डायगà¥à¤¨à¥‹à¤¸à¥à¤Ÿà¤¿à¤•", "MenuGeneralSettings": "सामानà¥à¤¯ सेटिंगà¥à¤¸", "MenuManage": "नियंतà¥à¤°à¤¿à¤¤ करें", diff --git a/lang/id.json b/lang/id.json index 60bf646282c79754fcd18b93f7842d232a6f0148..b95f95746cb6a5708300586a9e19f468f0143af4 100644 --- a/lang/id.json +++ b/lang/id.json @@ -141,7 +141,6 @@ "LogoNotWriteable": "Untuk menggunakan logo kustom, Piwik membutuhkan akses tulis ke file logo dalam direktori tema: %s", "LogoUpload": "Pilih Logo untuk diunggah", "LogoUploadDescription": "Silakan unggah berkas dalam format %s, tanpa latar belakang transparan, dengan ketinggian minimal %s piksel.", - "MenuCommunity": "Komunitas", "MenuDiagnostic": "Diagnosis", "MenuGeneralSettings": "Pengaturan Umum", "MenuManage": "Kelola", diff --git a/lang/it.json b/lang/it.json index 6f28eedd6e9eab38dd1ff51f39c94bf5776de333..ad0b680e0355231f2f09f1dd02e58cb130734975 100644 --- a/lang/it.json +++ b/lang/it.json @@ -145,7 +145,6 @@ "LogoNotWriteable": "Per usare un logo personalizzato Piwik richiede i permessi di scrittura della cartella dei temi: %s", "LogoUpload": "Seleziona un logo da caricare", "LogoUploadDescription": "Per favore carica un file in formato %s, senza trasparenza, con un minimo di %s pixel.", - "MenuCommunity": "Comunità ", "MenuDiagnostic": "Diagnostica", "MenuGeneralSettings": "Impostazioni generali", "MenuManage": "Gestione", diff --git a/lang/ja.json b/lang/ja.json index 79ef4892b2e4f58c0bb1c796b1c321ae97f9e879..0b4eaf91cd56f2ebe7822d9a71b079b75473104a 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -141,7 +141,6 @@ "LogoNotWriteable": "カスタムãƒã‚´ã‚’使用ã™ã‚‹ã«ã¯themesディレクトリ:%s ã®ä¸ã®ãƒã‚´ãƒ•ã‚¡ã‚¤ãƒ«ã¸ã®æ›¸ãè¾¼ã¿æ¨©é™ãŒå¿…è¦ã§ã™ã€‚", "LogoUpload": "アップãƒãƒ¼ãƒ‰ã™ã‚‹ãƒã‚´ã‚’é¸æŠž", "LogoUploadDescription": "ファイル㯠%s フォーマットã€é€æ˜ŽèƒŒæ™¯ãªã—ã€æœ€å°é«˜ã• %s ピクセルã§ã‚¢ãƒƒãƒ—ãƒãƒ¼ãƒ‰ã—ã¦ãã ã•ã„。", - "MenuCommunity": "コミュニティ", "MenuDiagnostic": "診æ–", "MenuGeneralSettings": "全般ã®è¨å®š", "MenuManage": "管ç†", diff --git a/lang/ko.json b/lang/ko.json index c499967aab7b6a19c10898194371441d16d7d54b..8ef2e41d4048e460a16c827b9cb0045a92268089 100644 --- a/lang/ko.json +++ b/lang/ko.json @@ -108,7 +108,6 @@ "LogoNotWriteable": "ë¡œê³ ë¥¼ ë³€ê²½í•˜ë ¤ë©´ themes ë””ë ‰í† ë¦¬ì˜ ë¡œê³ íŒŒì¼ì— 쓰기 ê¶Œí•œì´ ìžˆì–´ì•¼í•©ë‹ˆë‹¤: %s", "LogoUpload": "업로드 í• ë¡œê³ ì„ íƒ", "LogoUploadDescription": "파ì¼ì„ 업로드합니다. %s í¬ë§·ì´ë©° 투명 ë°°ê²½ì´ ì—†ê³ ìµœì†Œ 높ì´ê°€ %s 픽셀ì´ì–´ì•¼ 합니다.", - "MenuCommunity": "커뮤니티", "MenuDiagnostic": "진단", "MenuGeneralSettings": "ì¼ë°˜ ì„¤ì •", "MenuManage": "관리", diff --git a/lang/nl.json b/lang/nl.json index c5ab4b63faf60fc03c775c26d2263e75fb93bbdc..6901c666dd7513881c664b885ffbccbd3022dce2 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -142,7 +142,6 @@ "LogoNotWriteable": "Voor het gebruik van een aangepast logo heeft Piwik schrijfrechten nodig in de map met de logo-bestanden in de themes map: %s", "LogoUpload": "Selecteer een logo om te uploaden", "LogoUploadDescription": "Upload een bestand in de formaten %s, geen transparante achtergrond, met een minimum hoogte van %s pixels.", - "MenuCommunity": "Gemeenschap", "MenuDiagnostic": "Diagnose", "MenuGeneralSettings": "Algemene instellingen", "MenuManage": "Beheer", diff --git a/lang/pt-br.json b/lang/pt-br.json index dfb468355749b980dfa7e9bfe7e7cf143de38d40..7d83aa62deecf0a66ed7d51253425a82088d6d95 100644 --- a/lang/pt-br.json +++ b/lang/pt-br.json @@ -142,7 +142,6 @@ "LogoNotWriteable": "Para usar um logo personalizado o Piwik requer permissão de gravação ao diretório dos arquivos de temas: %s", "LogoUpload": "Selecione um logotipo para carregar", "LogoUploadDescription": "Faça upload de um arquivo no formato %s, sem nenhum fundo transparente e com uma altura mÃnima de %s pixels.", - "MenuCommunity": "Comunidade", "MenuDiagnostic": "Diagnostico", "MenuGeneralSettings": "Configurações Gerais", "MenuManage": "Gerenciar", diff --git a/lang/ro.json b/lang/ro.json index 1eb873dd229ecced771bdc8778af044742cad065..860b86960a4f4369bd6c91be5f1e66698075979d 100644 --- a/lang/ro.json +++ b/lang/ro.json @@ -93,7 +93,6 @@ "LatestBetaRelease": "Ultima versiune beta", "LatestStableRelease": "Ultima versiune stabilă", "LogoUpload": "Alege logo-ul pentru încărcare", - "MenuCommunity": "Comunitate", "MenuDiagnostic": "Diagnosticare", "MenuGeneralSettings": "Setări generale", "MenuManage": "Administrare", diff --git a/lang/ru.json b/lang/ru.json index 6f62b74fb1e1c8f2be2c725ef74fa4414a7c57e1..17e6073fe917123e5d19e0e3d287d2bfae64774f 100644 --- a/lang/ru.json +++ b/lang/ru.json @@ -138,7 +138,6 @@ "LogoNotWriteable": "Чтобы иÑпользовать пользовательÑкие лого, Piwik трубетÑÑ Ð¿Ñ€Ð°Ð²Ð° на запиÑÑŒ в папку Ð´Ð»Ñ Ð»Ð¾Ð³Ð¾: %s", "LogoUpload": "Выберите лого Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸", "LogoUploadDescription": "ПожалуйÑта, заливайте файлы форматов %s, прозрачный фон недопуÑтим, минимальное ограничение по выÑоте - %s пикÑелей.", - "MenuCommunity": "СообщеÑтво", "MenuDiagnostic": "ДиагноÑтика", "MenuGeneralSettings": "ОÑновные наÑтройки", "MenuManage": "Управление", diff --git a/lang/sl.json b/lang/sl.json index daaaa2e70beda150013024b0fcb5cd2f20357a22..47024262a39b99ea3b949de38ab297232410816a 100644 --- a/lang/sl.json +++ b/lang/sl.json @@ -72,7 +72,6 @@ "CustomLogoHelpText": "Piwik-ov logo lahko prilagodite po vaÅ¡ih željah. Spremembe bodo vidne tako v uporabniÅ¡kem vmesniku, kot v email poroÄilih.", "EmailServerSettings": "Nastavitev strežnika za email", "LogoUpload": "Izberite Logo za nalaganje", - "MenuCommunity": "Skupnost", "MenuDiagnostic": "Diagnostika", "MenuGeneralSettings": "SploÅ¡ne nastavitve", "MenuManage": "Upravljaj", diff --git a/lang/sq.json b/lang/sq.json index 858e797898f2651c6afd79aabe76be6f6285e4f1..f743c859d14ad695cc1416f91cc02cfd1ef0d49a 100644 --- a/lang/sq.json +++ b/lang/sq.json @@ -100,7 +100,6 @@ "LogoNotWriteable": "Që të përdorni një logo Piwik të përshtatur ju nevojitet të keni leje shkrimi te kartelat e logos brenda drejtorisë së temës: %s", "LogoUpload": "Përzgjidhni një Logo për ta ngarkuar", "LogoUploadDescription": "Ju lutem, ngarkoni një kartelë në format %s, pa sfond të tejdukshëm, me një lartësi minimale %s piksela.", - "MenuCommunity": "Bashkësi", "MenuDiagnostic": "Diagnostikim", "MenuGeneralSettings": "Rregullime të përgjithshme", "MenuManage": "Administroni", diff --git a/lang/sr.json b/lang/sr.json index 30b2706e15693c266348f0c2cfb3ca9ed1a776bd..641123b95edc6164ed39b74ad8e11ab127da5c80 100644 --- a/lang/sr.json +++ b/lang/sr.json @@ -142,7 +142,6 @@ "LogoNotWriteable": "Da biste koristili svoj logo za Piwik, potrebno je da omogućite prava za pisanje logo fajlovima u okviru foldera za teme: %s", "LogoUpload": "Izaberite logo za kaÄenje", "LogoUploadDescription": "Molimo vas da datoteka bude u formatima %s, bez transparencije i sa minimalnom visinom od %s piksela.", - "MenuCommunity": "Zajednica", "MenuDiagnostic": "Dijagnostika", "MenuGeneralSettings": "Osnovna podeÅ¡avanja", "MenuManage": "Upravljanje", diff --git a/lang/sv.json b/lang/sv.json index 711bf52fb10edee314d8aa234118280b3c9fd111..7e5a0ae448f4c55fba2dd160b6330dd28a3d74ed 100644 --- a/lang/sv.json +++ b/lang/sv.json @@ -122,7 +122,6 @@ "LogoNotWriteable": "För att kunna använda en anpassad logotyp för Piwik krävs skrivrättigheter till logotypfilerna i temakatalogen: %s", "LogoUpload": "Välj en logotyp att ladda upp", "LogoUploadDescription": "Vänligen ladda upp en fil i %s formatet, ingen transparent bakgrund, med en minsta höjd av %s pixlar.", - "MenuCommunity": "Community", "MenuDiagnostic": "Diagnostik", "MenuGeneralSettings": "Allmänna inställningar", "MenuManage": "Hantera", diff --git a/lang/ta.json b/lang/ta.json index c284eeb8e6097e0d15c8cbc09107642acc8596ae..fd1f7ec60238a2851dfd16e16264a5aca7a1b5c4 100644 --- a/lang/ta.json +++ b/lang/ta.json @@ -65,7 +65,6 @@ "LatestBetaRelease": "தறà¯à®ªà¯‹à®¤à¯ˆà®¯ நிலையறà¯à®± வெளியீடà¯", "LatestStableRelease": "தறà¯à®ªà¯‹à®¤à¯ˆà®¯ நிலையான வெளியீடà¯", "LogoUpload": "à®®à¯à®¤à¯à®¤à®¿à®°à¯ˆà®¯à¯ˆ தேரà¯à®µà¯ செயà¯à®•", - "MenuCommunity": "சமூகமà¯", "MenuDiagnostic": "ஆயà¯à®¨à¯à®¤à®±à®¿à®¤à®²à¯", "MenuGeneralSettings": "பொத௠அமைபà¯à®ªà¯à®•à®³à¯", "MenuManage": "மேலாணà¯à®®à¯ˆ", diff --git a/lang/th.json b/lang/th.json index 2549fc507b2538a8aadc11fc9c5ae9597028ecb5..050866113ea7b0ea62385761669e24a984103215 100644 --- a/lang/th.json +++ b/lang/th.json @@ -68,7 +68,6 @@ "Administration": "à¸à¸²à¸£à¸ˆà¸±à¸”à¸à¸²à¸£à¸£à¸°à¸šà¸š", "EmailServerSettings": "à¸à¸²à¸£à¸•à¸±à¹‰à¸‡à¸„่าเซิร์ฟเวà¸à¸£à¹Œà¸à¸µà¹€à¸¡à¸¥à¹Œ", "LogoUpload": "เลืà¸à¸à¸£à¸¹à¸›à¹‚ลโà¸à¹‰à¸—ี่ต้à¸à¸‡à¸à¸²à¸£à¸à¸±à¸žà¹‚หลด", - "MenuCommunity": "คà¸à¸¡à¸¡à¸¹à¸™à¸´à¸•à¸µà¹‰", "MenuGeneralSettings": "ตั้งค่าทั่วไป", "MenuManage": "จัดà¸à¸²à¸£", "OptOutComplete": "เลืà¸à¸à¸—ี่จะไม่ครบถ้วนเมื่à¸à¸„ุณเยี่ยมชมเว็บไซต์นี้จะไม่ถูà¸à¸šà¸±à¸™à¸—ึà¸à¹‚ดยเครื่à¸à¸‡à¸¡à¸·à¸à¸§à¸´à¹€à¸„ราะห์เว็บ", diff --git a/lang/tr.json b/lang/tr.json index e92dd5892e0fbf07814339881303a6b494a7e095..20205b9984eb87d3d2f01e940bb467783ffb722f 100644 --- a/lang/tr.json +++ b/lang/tr.json @@ -124,7 +124,6 @@ "LogoNotWriteable": "Logoyu deÄŸiÅŸtirmek için, Piwik için tema dizinindeki logo dosyalarına yazma hakkı gerekir: %s", "LogoUpload": "Yüklemek için logo seçiniz", "LogoUploadDescription": "Arka planı transparan olmayan dosyalarınızı %s formatlarında ve minimum yüksekliÄŸi %s olarak yükleyiniz.", - "MenuCommunity": "Topluluk", "MenuDiagnostic": "tehÅŸis", "MenuGeneralSettings": "Genel Ayarlar", "MenuManage": "yönetmek", diff --git a/lang/zh-cn.json b/lang/zh-cn.json index 17e247fde96c564ca62fd9fbb1cf3d41bfff74ef..ad64ab2f0eacfdf98ca9cb601082270b833f5517 100644 --- a/lang/zh-cn.json +++ b/lang/zh-cn.json @@ -142,7 +142,6 @@ "LogoNotWriteable": "Piwik需è¦ä¸»é¢˜æ–‡ä»¶å¤¹å†…%s的写æƒé™åŽ»è‡ªå®šä¹‰æ‚¨çš„logo", "LogoUpload": "é€‰æ‹©ä¸€ä¸ªå›¾æ ‡ä¸Šä¼ ", "LogoUploadDescription": "è¯·ä¸Šä¼ %s æ ¼å¼çš„文件,ä¸è¦é€æ˜ŽèƒŒæ™¯ï¼Œæœ€ä½Žé«˜åº¦ %s åƒç´ 。", - "MenuCommunity": "社区", "MenuDiagnostic": "检测", "MenuGeneralSettings": "一般设置", "MenuManage": "管ç†", diff --git a/piwik.php b/piwik.php index 2f06ef42a1f67d6139c4de4bb65d841d8c0b82fc..2df92969dfb6b3ac44131c3950674970c9b54a65 100644 --- a/piwik.php +++ b/piwik.php @@ -42,6 +42,8 @@ require_once PIWIK_INCLUDE_PATH . '/core/Plugin.php'; require_once PIWIK_INCLUDE_PATH . '/core/Common.php'; require_once PIWIK_INCLUDE_PATH . '/core/IP.php'; require_once PIWIK_INCLUDE_PATH . '/core/UrlHelper.php'; +require_once PIWIK_INCLUDE_PATH . '/core/Url.php'; +require_once PIWIK_INCLUDE_PATH . '/core/SettingsPiwik.php'; require_once PIWIK_INCLUDE_PATH . '/core/Tracker.php'; require_once PIWIK_INCLUDE_PATH . '/core/Config.php'; require_once PIWIK_INCLUDE_PATH . '/core/Translate.php'; diff --git a/plugins/CoreAdminHome/CoreAdminHome.php b/plugins/CoreAdminHome/CoreAdminHome.php index da1dce264dc261fac9147b9d9a6ad1cb18374725..3583748b9d96196631f087e680d03a85fdd5529a 100644 --- a/plugins/CoreAdminHome/CoreAdminHome.php +++ b/plugins/CoreAdminHome/CoreAdminHome.php @@ -81,8 +81,7 @@ class CoreAdminHome extends \Piwik\Plugin function addMenu() { Piwik_AddAdminSubMenu('CoreAdminHome_MenuManage', null, "", Piwik::isUserHasSomeAdminAccess(), $order = 1); - Piwik_AddAdminSubMenu('CoreAdminHome_MenuCommunity', null, "", Piwik::isUserHasSomeAdminAccess(), $order = 3); - Piwik_AddAdminSubMenu('CoreAdminHome_MenuDiagnostic', null, "", Piwik::isUserHasSomeAdminAccess(), $order = 20); + Piwik_AddAdminSubMenu('CoreAdminHome_MenuDiagnostic', null, "", Piwik::isUserHasSomeAdminAccess(), $order = 6); Piwik_AddAdminSubMenu('General_Settings', null, "", Piwik::isUserHasSomeAdminAccess(), $order = 5); Piwik_AddAdminSubMenu('General_Settings', 'CoreAdminHome_MenuGeneralSettings', array('module' => 'CoreAdminHome', 'action' => 'generalSettings'), diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php index cd664b3aefab1679e5cdb5b4ad4d1b1ffe3aa386..ff58b45d9c27dba1a4e8c68ea19a0178ab5f7928 100644 --- a/plugins/CorePluginsAdmin/PluginInstaller.php +++ b/plugins/CorePluginsAdmin/PluginInstaller.php @@ -11,6 +11,7 @@ namespace Piwik\Plugins\CorePluginsAdmin; use Piwik\Filechecks; use Piwik\Filesystem; +use Piwik\SettingsPiwik; use Piwik\Unzip; /** @@ -34,6 +35,9 @@ class PluginInstaller $tmpPluginZip = PIWIK_USER_PATH . self::PATH_TO_DOWNLOAD . $this->pluginName . '.zip'; $tmpPluginFolder = PIWIK_USER_PATH . self::PATH_TO_DOWNLOAD . $this->pluginName; + $tmpPluginZip = SettingsPiwik::rewriteTmpPathWithHostname($tmpPluginZip); + $tmpPluginFolder = SettingsPiwik::rewriteTmpPathWithHostname($tmpPluginFolder); + $this->makeSureFoldersAreWritable(); $this->makeSurePluginNameIsValid(); $this->downloadPluginFromMarketplace($tmpPluginZip); diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index c5fd949d40a12a75e5058b7723b11a73eec4e457..59b6645af0c310af1a7ac861d67713b1aebc8ec7 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -21,6 +21,7 @@ use Piwik\Filesystem; use Piwik\Http; use Piwik\Piwik; use Piwik\Plugins\LanguagesManager\LanguagesManager; +use Piwik\SettingsPiwik; use Piwik\SettingsServer; use Piwik\Unzip; use Piwik\UpdateCheck; @@ -43,6 +44,7 @@ class Controller extends \Piwik\Controller private $warningMessages = array(); private $errorMessages = array(); private $deactivatedPlugins = array(); + private $pathPiwikZip = false; static protected function getLatestZipUrl($newVersion) { @@ -127,17 +129,22 @@ class Controller extends \Piwik\Controller private function oneClick_Download() { - $this->pathPiwikZip = PIWIK_USER_PATH . self::PATH_TO_EXTRACT_LATEST_VERSION . 'latest.zip'; + $pathPiwikZip = PIWIK_USER_PATH . self::PATH_TO_EXTRACT_LATEST_VERSION . 'latest.zip'; + $this->pathPiwikZip = SettingsPiwik::rewriteTmpPathWithHostname($pathPiwikZip); + Filechecks::dieIfDirectoriesNotWritable(array(self::PATH_TO_EXTRACT_LATEST_VERSION)); // we catch exceptions in the caller (i.e., oneClickUpdate) $url = self::getLatestZipUrl($this->newVersion) . '?cb=' . $this->newVersion; - $fetched = Http::fetchRemoteFile($url, $this->pathPiwikZip); + + Http::fetchRemoteFile($url, $this->pathPiwikZip); } private function oneClick_Unpack() { $pathExtracted = PIWIK_USER_PATH . self::PATH_TO_EXTRACT_LATEST_VERSION; + $pathExtracted = SettingsPiwik::rewriteTmpPathWithHostname($pathExtracted); + $this->pathRootExtractedPiwik = $pathExtracted . 'piwik'; if (file_exists($this->pathRootExtractedPiwik)) { diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php index 7e8237a6a340671b96d6019ee5089c5c5a368d9b..c57677e3b4ac0422983910285bc98a8fed47f655 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php @@ -91,9 +91,9 @@ class Evolution extends JqplotGraph $defaultLastN = self::getDefaultLastN($period); $originalDate = Common::getRequestVar('date', 'last' . $defaultLastN, 'string'); - if ($period != 'range') { // show evolution limit if the period is not a range - $view->show_limit_control = true; - + if ($period == 'range') { // show evolution limit if the period is not a range + $view->show_limit_control = false; + } else { // set the evolution_{$period}_last_n query param if (Range::parseDateRange($originalDate)) { // if a multiple period // overwrite last_n param using the date range diff --git a/plugins/DBStats/DBStats.php b/plugins/DBStats/DBStats.php index ba1dca5fbe5275f042e7430326f244ff454ca103..badc024058dcf5dd7364cbeb2e705b20e7360acb 100644 --- a/plugins/DBStats/DBStats.php +++ b/plugins/DBStats/DBStats.php @@ -43,7 +43,7 @@ class DBStats extends \Piwik\Plugin Piwik_AddAdminSubMenu('CoreAdminHome_MenuDiagnostic', 'DBStats_DatabaseUsage', array('module' => 'DBStats', 'action' => 'index'), Piwik::isUserIsSuperUser(), - $order = 9); + $order = 6); } /** diff --git a/plugins/ImageGraph/StaticGraph.php b/plugins/ImageGraph/StaticGraph.php index cd4786f090e1cc316bd40c3cf528a0240908fb3a..f3be3b18be4806a70d51197ca24ef89585593a83 100644 --- a/plugins/ImageGraph/StaticGraph.php +++ b/plugins/ImageGraph/StaticGraph.php @@ -16,6 +16,7 @@ use Piwik\Loader; use Piwik\Plugins\ImageGraph\API; use pData; use pImage; +use Piwik\SettingsPiwik; require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pDraw.class.php"; require_once PIWIK_INCLUDE_PATH . "/libs/pChart2.1.3/class/pImage.class.php"; @@ -243,6 +244,8 @@ abstract class StaticGraph protected static function getOutputPath($filename) { $outputFilename = PIWIK_USER_PATH . '/tmp/assets/' . $filename; + $outputFilename = SettingsPiwik::rewriteTmpPathWithHostname($outputFilename); + @chmod($outputFilename, 0600); @unlink($outputFilename); return $outputFilename; diff --git a/plugins/Live/templates/getVisitorProfilePopup.twig b/plugins/Live/templates/getVisitorProfilePopup.twig index 55625942d65bc25a72eb76cdd8417186eccacf8d..678edfd039c54f660b815336254118030bff4077 100644 --- a/plugins/Live/templates/getVisitorProfilePopup.twig +++ b/plugins/Live/templates/getVisitorProfilePopup.twig @@ -38,10 +38,10 @@ {%- if not loop.first %}, {% endif -%}{{- totalConversions }} <span class="visitor-profile-goal-name">{{ goals[idGoal]['name'] -}}</span> {%- endfor -%} ){% endif %}.</p> - {% if visitorData.totalEcommerceConversions is defined or visitorData.totalAbandonedCarts is defined %} + {% if visitorData.totalEcommerceConversions|default(0) > 0 or visitorData.totalAbandonedCarts|default(0) > 0%} <p> {{ 'Goals_Ecommerce'|translate }}: - {%- if visitorData.totalEcommerceConversions is defined %} {{ 'Live_EcommerceSummaryConversions'|translate('<strong>', visitorData.totalEcommerceConversions, visitorData.totalEcommerceRevenue|money(idSite), '</strong>', visitorData.totalEcommerceItems)|raw }} + {%- if visitorData.totalEcommerceConversions|default(0) > 0 %} {{ 'Live_EcommerceSummaryConversions'|translate('<strong>', visitorData.totalEcommerceConversions, visitorData.totalEcommerceRevenue|money(idSite), '</strong>', visitorData.totalEcommerceItems)|raw }} {%- endif -%} {%- if visitorData.totalAbandonedCarts|default(0) > 0 %} {{ 'Live_AbandonedCartSummary'|translate('<strong>', visitorData.totalAbandonedCarts, '</strong>', visitorData.totalAbandonedCartsItems, '<strong>', visitorData.totalAbandonedCartsRevenue|money(idSite), '</strong>')|raw }}{%- endif -%} </p> diff --git a/plugins/PDFReports/config/tcpdf_config.php b/plugins/PDFReports/config/tcpdf_config.php index f9b2de9a6f7d805f0d805795275693da1d8cac68..3662df3099be307a3292f7d8fe1ce5d115ab3b7e 100644 --- a/plugins/PDFReports/config/tcpdf_config.php +++ b/plugins/PDFReports/config/tcpdf_config.php @@ -16,8 +16,12 @@ */ define('K_PATH_MAIN', PIWIK_INCLUDE_PATH . '/libs/tcpdf/'); -define('K_PATH_CACHE', PIWIK_USER_PATH . '/tmp/tcpdf/'); -define('K_PATH_IMAGES', PIWIK_USER_PATH . '/tmp/tcpdf/'); + +$pathTmpTCPDF = PIWIK_USER_PATH . '/tmp/tcpdf/'; +$pathTmpTCPDF = \Piwik\SettingsPiwik::rewriteTmpPathWithHostname($pathTmpTCPDF); + +define('K_PATH_CACHE', $pathTmpTCPDF); +define('K_PATH_IMAGES', $pathTmpTCPDF); if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { diff --git a/tests/PHPUnit/Core/LogTest.php b/tests/PHPUnit/Core/LogTest.php index 1ae78c63a3cd067f6b47188c12d5a15988d007c0..e3c3cde4ae189f4163796e97b8aa944da0bf1c4f 100644 --- a/tests/PHPUnit/Core/LogTest.php +++ b/tests/PHPUnit/Core/LogTest.php @@ -65,7 +65,7 @@ dummy backtrace' parent::setUp(); Config::getInstance()->log['string_message_format'] = self::STRING_MESSAGE_FORMAT; - Config::getInstance()->log['logger_file_path'] = self::getLogFileLocation(); + Config::getInstance()->log['logger_file_path'] = self::getDefaultLogFileLocation(); @unlink(self::getLogFileLocation()); Log::clearInstance(); Error::$debugBacktraceForTests = ExceptionHandler::$debugBacktraceForTests = "dummy backtrace"; @@ -258,6 +258,15 @@ dummy backtrace' public static function getLogFileLocation() { - return PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.test.log'; + $path = self::getDefaultLogFileLocation(); + $path = \Piwik\SettingsPiwik::rewriteTmpPathWithHostname($path); + return $path; } + + protected static function getDefaultLogFileLocation() + { + $path = PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.test.log'; + return $path; + } + } \ No newline at end of file diff --git a/tests/PHPUnit/Core/ServeStaticFileTest.php b/tests/PHPUnit/Core/ServeStaticFileTest.php index 40a65b02dacc629c87497d6cbdf3a33095ec4c72..0776f1c9aaa5bc12e834307555d81951dc4678b4 100644 --- a/tests/PHPUnit/Core/ServeStaticFileTest.php +++ b/tests/PHPUnit/Core/ServeStaticFileTest.php @@ -477,7 +477,8 @@ class Test_Piwik_ServeStaticFile extends PHPUnit_Framework_TestCase private function getCompressedFileLocation() { - return PIWIK_PATH_TEST_TO_ROOT . Piwik::COMPRESSED_FILE_LOCATION . basename(TEST_FILE_LOCATION); + $path = PIWIK_PATH_TEST_TO_ROOT . \Piwik\AssetManager::COMPRESSED_FILE_LOCATION . basename(TEST_FILE_LOCATION); + return \Piwik\SettingsPiwik::rewriteTmpPathWithHostname($path); } private function removeCompressedFiles() diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index a209d62a45911770c655f879f546a15348bdcafc..8b7ead59986b18d2bbc4e0fd097838e5237490f0 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit a209d62a45911770c655f879f546a15348bdcafc +Subproject commit 8b7ead59986b18d2bbc4e0fd097838e5237490f0 diff --git a/tests/travis/prepare.sh b/tests/travis/prepare.sh index 8ba216da70d4961bc10251f90ceecb58053b4460..93bed0daf7514e312e6e52ce21b190ec0a687868 100755 --- a/tests/travis/prepare.sh +++ b/tests/travis/prepare.sh @@ -30,8 +30,8 @@ fi mkdir ./tmp/assets mkdir ./tmp/cache mkdir ./tmp/latest +mkdir ./tmp/logs mkdir ./tmp/sessions mkdir ./tmp/templates_c mkdir ./tmp/tcpdf -mkdir ./tmp/logs chmod a+rw ./tests/lib/geoip-files