summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-22 17:34:20 +0100
committerLukas Reschke <lukas@owncloud.com>2016-03-22 17:34:20 +0100
commit1fffc30cf0a0d7402dd2834373b71670432d71b7 (patch)
treed06a5afc5a8f61d14fa91db84b260a288d071594 /lib
parent460bafea8a636beb450c939f0bfe57dc0229a8c2 (diff)
downloadnextcloud-server-1fffc30cf0a0d7402dd2834373b71670432d71b7.tar.gz
nextcloud-server-1fffc30cf0a0d7402dd2834373b71670432d71b7.zip
Only use the user session if ownCloud is already installed
When installing ownCloud with autotest and MySQL some log entries may be created which will invoke the logging class. IUserSession has a dependency on the database which will make the installation fail => :bomb:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/log/owncloud.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php
index ec4af29dc84..9c106299e4c 100644
--- a/lib/private/log/owncloud.php
+++ b/lib/private/log/owncloud.php
@@ -90,7 +90,11 @@ class OC_Log_Owncloud {
$time = $time->format($format);
$url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--';
$method = is_string($request->getMethod()) ? $request->getMethod() : '--';
- $userObj = \OC::$server->getUserSession()->getUser();
+ if(\OC::$server->getConfig()->getSystemValue('installed', false)) {
+ $userObj = \OC::$server->getUserSession()->getUser();
+ } else {
+ $userObj = null;
+ }
$user = !is_null($userObj) ? $userObj->getUID() : '--';
$entry = compact(
'reqId',