From 0183635c02610f41b7314b22c36c2e1d7512694e Mon Sep 17 00:00:00 2001 From: nathangray Date: Thu, 5 Oct 2017 09:50:19 -0600 Subject: [PATCH] Add permission check for collabora before setting actions to open in editor --- api/src/Storage/Merge.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index e835381903..197494a95a 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -1867,15 +1867,20 @@ abstract class Merge $documents = array(); $editable_mimes = array(); if ($export_limit == null) $export_limit = self::getExportLimit(); // check if there is a globalsetting + try { - if (class_exists('EGroupware\\collabora\\Bo') && $discovery = \EGroupware\collabora\Bo::discover()) + if (class_exists('EGroupware\\collabora\\Bo') && + $GLOBALS['egw_info']['user']['apps']['collabora'] && + $discovery = \EGroupware\collabora\Bo::discover() + ) { $editable_mimes = $discovery; } } - catch (\Exception $e) { - unset($e); + catch (\Exception $e) + { // ignore failed discovery + unset($e); } if ($default_doc && ($file = Api\Vfs::stat($default_doc))) // put default document on top {