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:
authormattab <matthieu.aubry@gmail.com>2013-11-19 07:25:27 +0400
committermattab <matthieu.aubry@gmail.com>2013-11-19 07:25:27 +0400
commit7146deafbd85f2f061780224ce8e9cc23c3813c4 (patch)
treeae7beec7ec66323b9fb66bf8e44f7d8ad6b223f9 /core/Filechecks.php
parentd12d5ea58cd5475295616d4ad12775ae9ce7b757 (diff)
Writing current user the script is running (whoami) so user knows why permission checks fail
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>"