summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-08-01 13:04:55 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-08-01 13:04:55 +0200
commit9253627327a35c9446f413bc487c2d7b0f63f9af (patch)
tree44e2ebe68a69a96278fa34a65a893901717d4ec1 /lib/public
parent30963d60bc0bb206fc55d27f04b505ed59e0892d (diff)
downloadnextcloud-server-9253627327a35c9446f413bc487c2d7b0f63f9af.tar.gz
nextcloud-server-9253627327a35c9446f413bc487c2d7b0f63f9af.zip
cancel sharing if some users doesn't have a working encryption set-up.
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/share.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index b349dd48776..63645e6fa34 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -1288,6 +1288,8 @@ class Share {
if ($shareType == self::SHARE_TYPE_GROUP) {
$groupItemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith['group'],
$uidOwner, $suggestedItemTarget);
+ $run = true;
+ $error = '';
\OC_Hook::emit('OCP\Share', 'pre_shared', array(
'itemType' => $itemType,
'itemSource' => $itemSource,
@@ -1297,8 +1299,15 @@ class Share {
'uidOwner' => $uidOwner,
'permissions' => $permissions,
'fileSource' => $fileSource,
- 'token' => $token
+ 'token' => $token,
+ 'run' => &$run,
+ 'error' => &$error
));
+
+ if ($run === false) {
+ throw new \Exception($error);
+ }
+
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {
@@ -1374,6 +1383,8 @@ class Share {
} else {
$itemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
$suggestedItemTarget);
+ $run = true;
+ $error = '';
\OC_Hook::emit('OCP\Share', 'pre_shared', array(
'itemType' => $itemType,
'itemSource' => $itemSource,
@@ -1383,8 +1394,15 @@ class Share {
'uidOwner' => $uidOwner,
'permissions' => $permissions,
'fileSource' => $fileSource,
- 'token' => $token
+ 'token' => $token,
+ 'run' => &$run,
+ 'error' => &$error
));
+
+ if ($run === false) {
+ throw new \Exception($error);
+ }
+
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {