Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressbooks should be check for uid conccurency before accepting a vcard #11387

Closed
2 tasks done
skjnldsv opened this issue Sep 26, 2018 · 0 comments
Closed
2 tasks done
Assignees
Milestone

Comments

@skjnldsv
Copy link
Member

skjnldsv commented Sep 26, 2018

Like calendars:

$q = $this->db->getQueryBuilder();
$q->select($q->createFunction('COUNT(*)'))
->from('calendarobjects')
->where($q->expr()->eq('calendarid', $q->createNamedParameter($calendarId)))
->andWhere($q->expr()->eq('uid', $q->createNamedParameter($extraData['uid'])));
$result = $q->execute();
$count = (int) $result->fetchColumn();
$result->closeCursor();
if ($count !== 0) {
throw new \Sabre\DAV\Exception\BadRequest('Calendar object with uid already exists in this calendar collection.');
}

  • New db column
  • Migration path
@skjnldsv skjnldsv added bug help wanted 1. to develop Accepted and waiting to be taken care of feature: dav labels Sep 26, 2018
@skjnldsv skjnldsv added this to the Nextcloud 15 milestone Sep 26, 2018
@skjnldsv skjnldsv self-assigned this Sep 26, 2018
@nextcloud nextcloud deleted a comment from nextcloud-bot Sep 26, 2018
@MorrisJobke MorrisJobke removed 1. to develop Accepted and waiting to be taken care of help wanted labels Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants