aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/lib/FederatedShareProvider.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-24 16:49:16 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-24 16:49:16 +0200
commit89ed2c37bf656ceb772bb6759c8977a7dc78b3fb (patch)
tree4a467f829fcc748531cad54e7c08e06dd98d1b7d /apps/federatedfilesharing/lib/FederatedShareProvider.php
parent654cd18864c943d9ff93c2e6151bb6529fa44513 (diff)
downloadnextcloud-server-89ed2c37bf656ceb772bb6759c8977a7dc78b3fb.tar.gz
nextcloud-server-89ed2c37bf656ceb772bb6759c8977a7dc78b3fb.zip
Update share type constant usage
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federatedfilesharing/lib/FederatedShareProvider.php')
-rw-r--r--apps/federatedfilesharing/lib/FederatedShareProvider.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 228fab305b9..3cc9c8e58c1 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -171,7 +171,7 @@ class FederatedShareProvider implements IShareProvider {
$sharedBy = $share->getSharedBy();
$shareType = $share->getShareType();
- if ($shareType === \OCP\Share::SHARE_TYPE_REMOTE_GROUP &&
+ if ($shareType === IShare::TYPE_REMOTE_GROUP &&
!$this->isOutgoingServer2serverGroupShareEnabled()
) {
$message = 'It is not allowed to send federated group shares from this server.';
@@ -183,8 +183,8 @@ class FederatedShareProvider implements IShareProvider {
/*
* Check if file is not already shared with the remote user
*/
- $alreadyShared = $this->getSharedWith($shareWith, \OCP\Share::SHARE_TYPE_REMOTE, $share->getNode(), 1, 0);
- $alreadySharedGroup = $this->getSharedWith($shareWith, \OCP\Share::SHARE_TYPE_REMOTE_GROUP, $share->getNode(), 1, 0);
+ $alreadyShared = $this->getSharedWith($shareWith, IShare::TYPE_REMOTE, $share->getNode(), 1, 0);
+ $alreadySharedGroup = $this->getSharedWith($shareWith, IShare::TYPE_REMOTE_GROUP, $share->getNode(), 1, 0);
if (!empty($alreadyShared) || !empty($alreadySharedGroup)) {
$message = 'Sharing %1$s failed, because this item is already shared with %2$s';
$message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with %2$s', [$share->getNode()->getName(), $shareWith]);
@@ -628,7 +628,7 @@ class FederatedShareProvider implements IShareProvider {
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
->andWhere(
- $qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_REMOTE))
+ $qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_REMOTE))
);
/**
@@ -945,7 +945,7 @@ class FederatedShareProvider implements IShareProvider {
$qb = $this->dbConnection->getQueryBuilder();
$qb->delete('share')
- ->where($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_REMOTE)))
+ ->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_REMOTE)))
->andWhere($qb->expr()->eq('uid_owner', $qb->createNamedParameter($uid)))
->execute();
}
@@ -1072,7 +1072,7 @@ class FederatedShareProvider implements IShareProvider {
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('share_with', 'token', 'file_source')
->from('share')
- ->where($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_REMOTE)))
+ ->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_REMOTE)))
->andWhere($qb->expr()->in('file_source', $qb->createNamedParameter($ids, IQueryBuilder::PARAM_INT_ARRAY)))
->andWhere($qb->expr()->orX(
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),