summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-10-24 17:04:40 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-01 19:54:40 +0100
commit77f74b9780f416fad8d529e789d045ead1b81c89 (patch)
treef1098d8b6bc02603cad492c15a3895fdbbaa4651 /apps
parent318160647a62386b4fda5c04ddca04673bf97813 (diff)
downloadnextcloud-server-77f74b9780f416fad8d529e789d045ead1b81c89.tar.gz
nextcloud-server-77f74b9780f416fad8d529e789d045ead1b81c89.zip
handle case if no share-by-mail share provider is loaded
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php7
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php5
2 files changed, 11 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index f9c7d69cf5f..0f4173f8763 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -23,6 +23,7 @@
*/
namespace OCA\Files_Sharing\Controller;
+use OC\Share20\Exception\ProviderException;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSException;
@@ -556,7 +557,11 @@ class ShareAPIController extends OCSController {
$userShares = $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_USER, $path, $reshares, -1, 0);
$groupShares = $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_GROUP, $path, $reshares, -1, 0);
$linkShares = $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_LINK, $path, $reshares, -1, 0);
- $mailShares = $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_EMAIL, $path, $reshares, -1, 0);
+ if ($this->shareManager->shareProviderExists(\OCP\Share::SHARE_TYPE_EMAIL)) {
+ $mailShares = $this->shareManager->getSharesBy($this->currentUser, \OCP\Share::SHARE_TYPE_EMAIL, $path, $reshares, -1, 0);
+ } else {
+ $mailShares = [];
+ }
$shares = array_merge($userShares, $groupShares, $linkShares, $mailShares);
if ($this->shareManager->outgoingServer2ServerSharesAllowed()) {
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index d5d877f4673..4af332a1184 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -446,6 +446,11 @@ class ShareesAPIController extends OCSController {
$shareTypes = array_diff($shareTypes, [Share::SHARE_TYPE_REMOTE]);
}
+ if (!$this->shareManager->shareProviderExists(Share::SHARE_TYPE_EMAIL)) {
+ // Remove mail shares from type array, because the share provider is not loaded
+ $shareTypes = array_diff($shareTypes, [Share::SHARE_TYPE_EMAIL]);
+ }
+
$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
$this->limit = (int) $perPage;