From 83b27bbb4e04688a779fde7eda9c4e22fa096774 Mon Sep 17 00:00:00 2001
From: nbm
Date: Thu, 7 Apr 2005 11:04:59 +0000
Subject: [PATCH] Make it clear which user needs to own/write to the log and Documents directory.
---
setup/precheckup.php | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/setup/precheckup.php b/setup/precheckup.php
index d773fa7..21ba2ce 100644
--- a/setup/precheckup.php
+++ b/setup/precheckup.php
@@ -149,12 +149,31 @@ $phpversion4 = phpversion() < '4' ? 'No (
$phpversion43 = phpversion() < '4.3' ? 'No (PHP 4.3 is recommended)' : 'Yes';
$phpversion5 = phpversion() >= '5' ? 'No (KnowledgeTree does not yet work with PHP5)' : 'Yes';
+function running_user() {
+ if (substr(PHP_OS, 0, 3) == "WIN") {
+ return null;
+ }
+ if (extension_loaded("posix")) {
+ $uid = posix_getuid();
+ $userdetails = posix_getpwuid($uid);
+ return $userdetails['name'];
+ }
+ if (file_exists('/usr/bin/whoami')) {
+ return exec('/usr/bin/whoami');
+ }
+ if (file_exists('/usr/bin/id')) {
+ return exec('/usr/bin/id -nu');
+ }
+ return null;
+}
+
?>
KnowledgeTree Checkup
@@ -283,6 +302,18 @@ PHP you are running, and which modules are available.
=writablePath('Log directory', 'log')?>
+log and Documents directories.";
+} else {
+ $message = 'KnowledgeTree will be run as the ' . $username . ' system user, and must be able to write to the log and Documents directories.';
+}
+?>
+
+| General |
+=$message?> |
+
--
libgit2 0.21.4