Skip to content

Commit

Permalink
#871: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuaitk committed Mar 4, 2024
1 parent c2b4226 commit 0f51146
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions modules/os2forms_nemid/os2forms_nemid.module
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,11 @@ function os2forms_nemid_webform_submission_form_alter(array &$form, FormStateInt
// Users often login on behalf of company as themselves
// i.e. values may contain both a cpr and cvr value,
// and they will be considered authenticated as company AND person.
if ($webform_type === NemidElementBase::WEBFORM_TYPE_COMPANY) {
if (!$authProviderPlugin->isAuthenticatedCompany()) {
_os2forms_nemid_add_authentication_warning_and_disable_form($form, $authProviderService->getLogoutUrl()->toString());
}
if ($webform_type === NemidElementBase::WEBFORM_TYPE_COMPANY && !$authProviderPlugin->isAuthenticatedCompany()) {
_os2forms_nemid_add_authentication_warning_and_disable_form($form, $authProviderService->getLogoutUrl()->toString());
}
elseif ($webform_type === NemidElementBase::WEBFORM_TYPE_PERSONAL) {
if (!$authProviderPlugin->isAuthenticatedPerson()) {
_os2forms_nemid_add_authentication_warning_and_disable_form($form, $authProviderService->getLogoutUrl()->toString());
}
elseif ($webform_type === NemidElementBase::WEBFORM_TYPE_PERSONAL && !$authProviderPlugin->isAuthenticatedPerson()) {
_os2forms_nemid_add_authentication_warning_and_disable_form($form, $authProviderService->getLogoutUrl()->toString());
}
}
}
Expand Down

0 comments on commit 0f51146

Please sign in to comment.