|
|
|
@ -450,6 +450,7 @@ class Share { |
|
|
|
|
$uidOwner, self::FORMAT_NONE, null, 1)) { |
|
|
|
|
// remember old token |
|
|
|
|
$oldToken = $checkExists['token']; |
|
|
|
|
$oldPermissions = $checkExists['permissions']; |
|
|
|
|
//delete the old share |
|
|
|
|
self::delete($checkExists['id']); |
|
|
|
|
} |
|
|
|
@ -460,8 +461,11 @@ class Share { |
|
|
|
|
$hasher = new \PasswordHash(8, $forcePortable); |
|
|
|
|
$shareWith = $hasher->HashPassword($shareWith.\OC_Config::getValue('passwordsalt', '')); |
|
|
|
|
} else { |
|
|
|
|
// reuse the already set password |
|
|
|
|
$shareWith = $checkExists['share_with']; |
|
|
|
|
// reuse the already set password, but only if we change permissions |
|
|
|
|
// otherwise the user disabled the password protection |
|
|
|
|
if ($checkExists && (int)$permissions !== (int)$oldPermissions) { |
|
|
|
|
$shareWith = $checkExists['share_with']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Generate token |
|
|
|
|