mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Remove entries in dav_shares on deletion of a calendar
This commit is contained in:
parent
a3cc448c9d
commit
81b9721700
3 changed files with 14 additions and 4 deletions
|
|
@ -340,6 +340,8 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
|
||||
$stmt = $this->db->prepare('DELETE FROM `*PREFIX*calendarchanges` WHERE `calendarid` = ?');
|
||||
$stmt->execute([$calendarId]);
|
||||
|
||||
$this->sharingBackend->deleteAllShares($calendarId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -336,10 +336,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
->setParameter('id', $addressBookId)
|
||||
->execute();
|
||||
|
||||
$query->delete('dav_shares')
|
||||
->where($query->expr()->eq('resourceid', $query->createNamedParameter($addressBookId)))
|
||||
->andWhere($query->expr()->eq('type', $query->createNamedParameter('addressbook')))
|
||||
->execute();
|
||||
$this->sharingBackend->deleteAllShares($addressBookId);
|
||||
|
||||
$query->delete($this->dbCardsPropertiesTable)
|
||||
->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
|
||||
|
|
|
|||
|
|
@ -96,6 +96,17 @@ class Backend {
|
|||
$query->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $resourceId
|
||||
*/
|
||||
public function deleteAllShares($resourceId) {
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->delete('dav_shares')
|
||||
->where($query->expr()->eq('resourceid', $query->createNamedParameter($resourceId)))
|
||||
->andWhere($query->expr()->eq('type', $query->createNamedParameter($this->resourceType)))
|
||||
->execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param IShareable $shareable
|
||||
* @param string $element
|
||||
|
|
|
|||
Loading…
Reference in a new issue