From 49008fd52999ea83444415706fff6fea87404f54 Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 5 Apr 2019 09:34:47 -0600 Subject: [PATCH] Support sharing from filemanager as an app, treating it as VFS --- api/src/Sharing.php | 2 +- api/src/Vfs/Sharing.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/Sharing.php b/api/src/Sharing.php index 77bfb93768..380357a1a5 100644 --- a/api/src/Sharing.php +++ b/api/src/Sharing.php @@ -366,7 +366,7 @@ class Sharing if(!$share) $share = $this->share; list($app, $id) = explode('::', $share['share_path']); return $share && $share['share_path'] && - $app && $id && $app !== 'vfs' ;//&& array_key_exists($app, $GLOBALS['egw_info']['apps']); + $app && $id && !in_array($app, array('filemanager', 'vfs')) ;//&& array_key_exists($app, $GLOBALS['egw_info']['apps']); } public function need_session() diff --git a/api/src/Vfs/Sharing.php b/api/src/Vfs/Sharing.php index 6473b9a0ff..1fe66988a0 100644 --- a/api/src/Vfs/Sharing.php +++ b/api/src/Vfs/Sharing.php @@ -198,6 +198,11 @@ class Sharing extends \EGroupware\Api\Sharing { if (!isset(self::$db)) self::$db = $GLOBALS['egw']->db; + // Parent puts the application as a prefix. If we're coming from there, pull it off + if(strpos($path, 'filemanager::') === 0) + { + list(,$path) = explode('::', $path); + } if (empty($name)) $name = $path; $path2tmp =& Api\Cache::getSession(__CLASS__, 'path2tmp');