summaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2013-08-05 14:27:38 +0200
committerGeorg Ehrke <developer@georgehrke.com>2013-08-05 14:27:38 +0200
commitaf983b843d1335917f4a702cea6d91d28bab68e9 (patch)
tree692e6e4090ef282b597b9b69d2abd53262cf47a0 /lib/public/share.php
parent554b1990e23c76aea182e9b8c2687f8f8b939fb9 (diff)
parent0fce89308e2fbcb44a2091ca67f373ba89ee068e (diff)
downloadnextcloud-server-af983b843d1335917f4a702cea6d91d28bab68e9.tar.gz
nextcloud-server-af983b843d1335917f4a702cea6d91d28bab68e9.zip
fix merge conflicts
Diffstat (limited to 'lib/public/share.php')
-rw-r--r--lib/public/share.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 596a729a47d..63645e6fa34 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -454,6 +454,9 @@ class Share {
$forcePortable = (CRYPT_BLOWFISH != 1);
$hasher = new \PasswordHash(8, $forcePortable);
$shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', ''));
+ } else {
+ // reuse the already set password
+ $shareWith = $checkExists['share_with'];
}
// Generate token
@@ -1285,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,
@@ -1294,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) {
@@ -1371,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,
@@ -1380,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) {