Skip to content

Commit fe1eadd

Browse files
Kaya84btry
authored andcommitted
fix(form): Form with restricted acces: redirect to login form if not logged in
If form has restriced access, and user is not logged in, it should show login form with redirect. Refer #2734
1 parent 5960a8d commit fe1eadd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

front/formdisplay.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
Html::displayNotFoundError();
5353
}
5454

55+
// If the form has restriced access and user is not logged in, send to login form
56+
if ($form->fields['access_rights'] == PluginFormcreatorForm::ACCESS_RESTRICTED && Session::getLoginUserID() === false) {
57+
Session::redirectIfNotLoggedIn();
58+
exit();
59+
}
60+
5561
if (!$form->canViewForRequest()) {
5662
Html::displayRightError();
5763
exit();

0 commit comments

Comments
 (0)