From 0c3c72aec02003cf09b3d2d1d8fcdb083f1e6db1 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Wed, 3 Sep 2014 03:12:35 +0200 Subject: Libreoffice config folder needs to be set In order to avoid conflicts between multiple instances installed on one server, it's required to define a LibreOffice configuration folder per instance. Just like with my PR for the documents app (https://github.com/owncloud/documents/pull/353), I propose to use /tmp/owncloud-instanceid --- lib/private/preview/office-cl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private') diff --git a/lib/private/preview/office-cl.php b/lib/private/preview/office-cl.php index 81e0cf4b6ae..2df189f4dbf 100644 --- a/lib/private/preview/office-cl.php +++ b/lib/private/preview/office-cl.php @@ -32,7 +32,7 @@ if (!\OC_Util::runningOnWindows()) { $defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir) . ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir '; $clParameters = \OCP\Config::getSystemValue('preview_office_cl_parameters', $defaultParameters); - $exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath); + $exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath) . ' -env:UserInstallation=file://' . escapeshellarg(get_temp_dir() . '/owncloud-' . \OC_Util::getInstanceId().'/'); shell_exec($exec); -- cgit v1.2.3 From eaab067716ed7f502bb267cad9704b0597669010 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Wed, 3 Sep 2014 16:08:40 +0200 Subject: env:UserInstallation was already there in master My changes were made against stable7 and I merged them to the file in master, so this version is now the properly merged file for master. I'm just adding `owncloud-` to the path where temp files are stored. --- lib/private/preview/office-cl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private') diff --git a/lib/private/preview/office-cl.php b/lib/private/preview/office-cl.php index 2df189f4dbf..42d2cbf34fc 100644 --- a/lib/private/preview/office-cl.php +++ b/lib/private/preview/office-cl.php @@ -29,10 +29,10 @@ if (!\OC_Util::runningOnWindows()) { $tmpDir = get_temp_dir(); - $defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir) . ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir '; + $defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir . '/owncloud-' . \OC_Util::getInstanceId().'/') . ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir '; $clParameters = \OCP\Config::getSystemValue('preview_office_cl_parameters', $defaultParameters); - $exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath) . ' -env:UserInstallation=file://' . escapeshellarg(get_temp_dir() . '/owncloud-' . \OC_Util::getInstanceId().'/'); + $exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath); shell_exec($exec); -- cgit v1.2.3