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

Commit 50d4bab

Browse files
committed
Fix failed remote share: make sure to remove unnecessary data on failure.
1 parent 7ed8c22 commit 50d4bab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,8 +1587,18 @@ public function shareNode($ajxpNode, $httpVars, &$update){
15871587
if($shareObject instanceof \Pydio\OCS\Model\TargettedLink){
15881588
$invitation = $shareObject->getPendingInvitation();
15891589
if(!empty($invitation)){
1590+
try{
1591+
$ocsClient->sendInvitation($invitation);
1592+
}catch (Exception $e){
1593+
$this->getShareStore()->deleteShare("minisite", $shareObject->getHash(), true);
1594+
$shareUserId = $shareObject->getUniqueUser();
1595+
unset($users[$shareUserId]);
1596+
if(!count($users) && !count($groups)){
1597+
$this->getShareStore()->deleteShare("repository", $newRepo->getId());
1598+
}
1599+
throw $e;
1600+
}
15901601
$ocsStore->storeInvitation($invitation);
1591-
$ocsClient->sendInvitation($invitation);
15921602
}
15931603
}else{
15941604
$this->getPublicAccessManager()->initFolder();

0 commit comments

Comments
 (0)