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

Commit

Permalink
Fix failed remote share: make sure to remove unnecessary data on fail…
Browse files Browse the repository at this point in the history
…ure.
  • Loading branch information
cdujeu committed Apr 8, 2016
1 parent 7ed8c22 commit 50d4bab
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/src/plugins/action.share/class.ShareCenter.php
Expand Up @@ -1587,8 +1587,18 @@ public function shareNode($ajxpNode, $httpVars, &$update){
if($shareObject instanceof \Pydio\OCS\Model\TargettedLink){
$invitation = $shareObject->getPendingInvitation();
if(!empty($invitation)){
try{
$ocsClient->sendInvitation($invitation);
}catch (Exception $e){
$this->getShareStore()->deleteShare("minisite", $shareObject->getHash(), true);
$shareUserId = $shareObject->getUniqueUser();
unset($users[$shareUserId]);
if(!count($users) && !count($groups)){
$this->getShareStore()->deleteShare("repository", $newRepo->getId());
}
throw $e;
}
$ocsStore->storeInvitation($invitation);
$ocsClient->sendInvitation($invitation);
}
}else{
$this->getPublicAccessManager()->initFolder();
Expand Down

0 comments on commit 50d4bab

Please sign in to comment.