From 0f5114645332efbfc6a9ad18d0f068191570bf32 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 4 Mar 2024 09:39:05 +0100 Subject: [PATCH] #871: Cleanup --- modules/os2forms_nemid/os2forms_nemid.module | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/modules/os2forms_nemid/os2forms_nemid.module b/modules/os2forms_nemid/os2forms_nemid.module index be77654..a24b0a5 100644 --- a/modules/os2forms_nemid/os2forms_nemid.module +++ b/modules/os2forms_nemid/os2forms_nemid.module @@ -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()); } } }