diff options
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 19 | ||||
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareesAPIController.php | 8 |
2 files changed, 16 insertions, 11 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index ae8165602a6..4f80b8fc966 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -502,7 +502,9 @@ class ShareAPIController extends OCSController { $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_USER, $node, false, -1, 0)); $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_GROUP, $node, false, -1, 0)); $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_LINK, $node, false, -1, 0)); - $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_EMAIL, $node, false, -1, 0)); + if($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { + $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_EMAIL, $node, false, -1, 0)); + } if ($this->shareManager->outgoingServer2ServerSharesAllowed()) { $shares = array_merge($shares, $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_REMOTE, $node, false, -1, 0)); } @@ -822,15 +824,18 @@ class ShareAPIController extends OCSController { } try { - $share = $this->shareManager->getShareById('ocMailShare:' . $id); - return $share; - } catch (ShareNotFound $e) { - if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) { - throw new ShareNotFound(); + if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) { + $share = $this->shareManager->getShareById('ocMailShare:' . $id); + return $share; } + } catch (ShareNotFound $e) { + // Do nothing, just try the other share type + } - $share = $this->shareManager->getShareById('ocFederatedSharing:' . $id); + if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) { + throw new ShareNotFound(); } + $share = $this->shareManager->getShareById('ocFederatedSharing:' . $id); return $share; } diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index 06878f04c35..8a9a59d8845 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -427,8 +427,8 @@ class ShareesAPIController extends OCSController { $shareTypes = [ Share::SHARE_TYPE_USER, - Share::SHARE_TYPE_EMAIL, - Share::SHARE_TYPE_REMOTE + Share::SHARE_TYPE_REMOTE, + Share::SHARE_TYPE_EMAIL ]; if ($this->shareManager->allowGroupSharing()) { @@ -504,12 +504,12 @@ class ShareesAPIController extends OCSController { } // Get remote - $remoteResults = ['results' => [], 'exact' => []]; + $remoteResults = ['results' => [], 'exact' => [], 'exactIdMatch' => false]; if (in_array(Share::SHARE_TYPE_REMOTE, $shareTypes)) { $remoteResults = $this->getRemote($search); } - $mailResults = ['results' => [], 'exact' => []]; + $mailResults = ['results' => [], 'exact' => [], 'exactIdMatch' => false]; if (in_array(Share::SHARE_TYPE_EMAIL, $shareTypes)) { $mailResults = $this->getEmail($search); } |