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:
Diffstat (limited to 'core/Filechecks.php')
-rw-r--r--core/Filechecks.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/Filechecks.php b/core/Filechecks.php
index 69fe7a412a..345ff14c6b 100644
--- a/core/Filechecks.php
+++ b/core/Filechecks.php
@@ -47,10 +47,7 @@ class Filechecks
$directoryToCheck = SettingsPiwik::rewriteTmpPathWithHostname($directoryToCheck);
- // Create an empty directory
- if (!file_exists($directoryToCheck)) {
- Filesystem::mkdir($directoryToCheck);
- }
+ Filesystem::mkdir($directoryToCheck);
$directory = Filesystem::realpath($directoryToCheck);
$resultCheck[$directory] = false;
@@ -90,10 +87,16 @@ class Filechecks
$directoryList = "<code>chown -R www-data:www-data " . $realpath . "</code><br />" . $directoryList;
}
- // The error message mentions chmod 777 in case users can't chown
+ if(function_exists('shell_exec')) {
+ $currentUser = trim(shell_exec('whoami'));
+ if(!empty($currentUser)) {
+ $optionalUserInfo = " (running as user '" . $currentUser . "')";
+ }
+ }
- $directoryMessage = "<p><b>Piwik couldn't write to some directories</b>.</p>";
- $directoryMessage .= "<p>Try to Execute the following commands on your server, to allow Write access on these directories:</p>"
+ $directoryMessage = "<p><b>Piwik couldn't write to some directories $optionalUserInfo</b>.</p>";
+ $directoryMessage .= "<p>Try to Execute the following commands on your server, to allow Write access on these directories"
+ . ":</p>"
. "<blockquote>$directoryList</blockquote>"
. "<p>If this doesn't work, you can try to create the directories with your FTP software, and set the CHMOD to 0755 (or 0777 if 0755 is not enough). To do so with your FTP software, right click on the directories then click permissions.</p>"
. "<p>After applying the modifications, you can <a href='index.php'>refresh the page</a>.</p>"