Skip to content

Commit

Permalink
fix(form): check access to form only by entity
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
Signed-off-by: btry <tbugier@teclib.com>
  • Loading branch information
btry committed Aug 6, 2018
1 parent 1a40790 commit c0973cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions front/formdisplay.php
Expand Up @@ -46,12 +46,15 @@
if (isset($_REQUEST['id'])
&& is_numeric($_REQUEST['id'])) {

$form->check($_REQUEST['id'], READ);
if ($form->getFromDB((int) $_REQUEST['id'])) {

if ($form->fields['access_rights'] != PluginFormcreatorForm::ACCESS_PUBLIC) {
Session::checkLoginUser();
if (!$form->checkEntity(true)) {
Html::displayRightError();
exit();
}
}

if ($form->fields['access_rights'] == PluginFormcreatorForm::ACCESS_RESTRICTED) {
$form_profile = new PluginFormcreatorForm_Profile();
$formId = $form->getID();
Expand Down

0 comments on commit c0973cb

Please sign in to comment.