Skip to content

Commit c0973cb

Browse files
committed
fix(form): check access to form only by entity
Signed-off-by: Thierry Bugier <tbugier@teclib.com> Signed-off-by: btry <tbugier@teclib.com>
1 parent 1a40790 commit c0973cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

front/formdisplay.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@
4646
if (isset($_REQUEST['id'])
4747
&& is_numeric($_REQUEST['id'])) {
4848

49-
$form->check($_REQUEST['id'], READ);
5049
if ($form->getFromDB((int) $_REQUEST['id'])) {
51-
5250
if ($form->fields['access_rights'] != PluginFormcreatorForm::ACCESS_PUBLIC) {
5351
Session::checkLoginUser();
52+
if (!$form->checkEntity(true)) {
53+
Html::displayRightError();
54+
exit();
55+
}
5456
}
57+
5558
if ($form->fields['access_rights'] == PluginFormcreatorForm::ACCESS_RESTRICTED) {
5659
$form_profile = new PluginFormcreatorForm_Profile();
5760
$formId = $form->getID();

0 commit comments

Comments
 (0)