Don't allow access if user has already taken part
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
parent
2e3be4d460
commit
c03647a1c4
5 changed files with 97 additions and 0 deletions
|
|
@ -527,6 +527,13 @@ class PageController extends Controller {
|
|||
return false;
|
||||
}
|
||||
if ($access === 'registered') {
|
||||
if ($form->getUnique()) {
|
||||
$participants = $this->voteMapper->findParticipantsByForm($form->getId());
|
||||
foreach($participants as $participant) {
|
||||
// Don't allow access if user has already taken part
|
||||
if ($participant->getUserId() === $this->userId) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if ($owner === $this->userId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue