Skip to content

Commit

Permalink
Merge pull request #270 from phili67/phili67-webdav-update
Browse files Browse the repository at this point in the history
Webdav update
  • Loading branch information
phili67 authored Apr 14, 2018
2 parents c368e30 + ff3cd87 commit d271706
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/EcclesiaCRM/model/EcclesiaCRM/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use EcclesiaCRM\ListOptionQuery;
use EcclesiaCRM\dto\SystemURLs;
use EcclesiaCRM\Utils\MiscUtils;
use EcclesiaCRM\NoteQuery;

/**
* Skeleton subclass for representing a row from the 'user_usr' table.
Expand Down Expand Up @@ -290,4 +291,13 @@ public function createTimeLineNote($type,$info = null)

$note->save();
}

public function deleteTimeLineNote($type,$info = null)
{
$notes = NoteQuery::Create ()->filterByPerId ($this->getPersonId())->findByText (str_replace("home/","",$info));

if (!empty($notes)) {
$notes->delete();
}
}
}
8 changes: 4 additions & 4 deletions src/EcclesiaCRM/sabre/EcclesiaCRMServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ function getCopyAndMoveInfo(RequestInterface $request) {
function updateProperties($path, array $properties) {
$res = parent::updateProperties($path, $properties);

return $res;
return $res;
}

function beforeUnbind($uri) {
if (strpos($uri,"._") == false && strpos($uri,".DS_Store") == false) {
$currentUser = UserQuery::create()->findOneByUserName($this->authBackend->getLoginName());
$currentUser->createTimeLineNote("dav-delete-file",$uri);
$currentUser->deleteTimeLineNote("dav-delete-file",$uri);
}

return true;
}
return true;
}


}
Expand Down

0 comments on commit d271706

Please sign in to comment.