handle case if no share-by-mail share provider is loaded
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
318160647a
commit
77f74b9780
|
@ -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()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -154,7 +154,11 @@
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue