*/
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;
$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()) {
$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;
var users = result.ocs.data.exact.users.concat(result.ocs.data.users);
var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups);
var remotes = result.ocs.data.exact.remotes.concat(result.ocs.data.remotes);
- var emails = result.ocs.data.exact.emails.concat(result.ocs.data.emails);
+ if (typeof(result.ocs.data.emails) !== 'undefined') {
+ var emails = result.ocs.data.exact.emails.concat(result.ocs.data.emails);
+ } else {
+ var emails = [];
+ }
var usersLength;
var groupsLength;