aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Share20
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-10-27 14:29:28 +0100
committerMorris Jobke <hey@morrisjobke.de>2021-03-15 15:55:08 +0100
commita55064970835b790ed6c9dfe865e655b9d76694b (patch)
treeea8be6f938e4d86c3585ecffec93834c96f6e7c4 /lib/private/Share20
parentf512705f8f3ba7ff676b139bbfc00dcf6d277bd1 (diff)
downloadnextcloud-server-a55064970835b790ed6c9dfe865e655b9d76694b.tar.gz
nextcloud-server-a55064970835b790ed6c9dfe865e655b9d76694b.zip
expand 'path is already shared' error message
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r--lib/private/Share20/Manager.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index ce1ec1d60f6..e915acc3db8 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -565,9 +565,10 @@ class Manager implements IManager {
//Shares are not identical
}
- // Identical share already existst
+ // Identical share already exists
if ($existingShare->getSharedWith() === $share->getSharedWith() && $existingShare->getShareType() === $share->getShareType()) {
- throw new AlreadySharedException('Path is already shared with this user', $existingShare);
+ $message = $this->l->t('Sharing %s failed, because this item is already shared with user %s', [$share->getNode()->getName(), $share->getSharedWithDisplayName()]);
+ throw new AlreadySharedException($message, $existingShare);
}
// The share is already shared with this user via a group share
@@ -577,7 +578,8 @@ class Manager implements IManager {
$user = $this->userManager->get($share->getSharedWith());
if ($group->inGroup($user) && $existingShare->getShareOwner() !== $share->getShareOwner()) {
- throw new AlreadySharedException('Path is already shared with this user', $existingShare);
+ $message = $this->l->t('Sharing %s failed, because this item is already shared with user %s', [$share->getNode()->getName(), $share->getSharedWithDisplayName()]);
+ throw new AlreadySharedException($message, $existingShare);
}
}
}