Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 253e3ea

Browse files
committed
Make sure to transfer an empty DATA_TEMPLATE value to child repository - Fix #1152
Fix broken unsharing.
1 parent fe99a69 commit 253e3ea

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/src/plugins/access.fs/class.fsAccessDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,9 @@ public function makeSharedRepositoryOptions($httpVars, $repository)
20402040
"PATH" => SystemTextEncoding::toStorageEncoding($repository->getOption("PATH")).AJXP_Utils::decodeSecureMagic($httpVars["file"]),
20412041
"CREATE" => $repository->getOption("CREATE"),
20422042
"RECYCLE_BIN" => isSet($httpVars["inherit_recycle"])? $repository->getOption("RECYCLE_BIN") : "",
2043-
"DEFAULT_RIGHTS" => "");
2043+
"DEFAULT_RIGHTS" => "",
2044+
"DATA_TEMPLATE" => ""
2045+
);
20442046
if ($repository->getOption("USE_SESSION_CREDENTIALS")===true) {
20452047
$newOptions["ENCODED_CREDENTIALS"] = AJXP_Safe::getEncodedCredentialString();
20462048
}

core/src/plugins/action.share/class.ShareCenter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public function switchAction($action, $httpVars, $fileVars)
709709
foreach($shares as $shareId => $share){
710710
$t = isSet($share["type"]) ? $share["type"] : "file";
711711
try{
712-
$result = $this->getShareStore()->deleteShare($t, $shareId);
712+
$result = $this->getShareStore()->deleteShare($t, $shareId, false, true);
713713
}catch(Exception $e){
714714
if($e->getMessage() == "repo-not-found"){
715715
$result = true;
@@ -941,7 +941,7 @@ public function updateNodeSharedData($oldNode=null, $newNode=null, $copy = false
941941
public function cleanUserShares($userId){
942942
$shares = $this->getShareStore()->listShares($userId);
943943
foreach($shares as $hash => $data){
944-
$this->getShareStore()->deleteShare($data['SHARE_TYPE'], $hash);
944+
$this->getShareStore()->deleteShare($data['SHARE_TYPE'], $hash, false, true);
945945
}
946946
}
947947

0 commit comments

Comments
 (0)