Merge pull request #23488 from owncloud/only-use-usersession-if-installed

Only use the user session if ownCloud is already installed
This commit is contained in:
Thomas Müller 2016-03-22 21:25:36 +01:00
commit b1e5adf197
1 changed files with 5 additions and 1 deletions

View File

@ -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',