/** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { $condition_values = (new FormState())->setValues($form_state->getValue(['gateway', 'paths'])); $this->gatewayPaths->validateConfigurationForm($form, $condition_values); $condition_values = (new FormState())->setValues($form_state->getValue(['forced_login', 'paths'])); $this->forcedLoginPaths->validateConfigurationForm($form, $condition_values); return parent::validateForm($form, $form_state); }
/** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) { $condition_values = (new FormState())->setValues($form_state->getValue(['gateway', 'paths'])); $this->gatewayPaths->validateConfigurationForm($form, $condition_values); $condition_values = (new FormState())->setValues($form_state->getValue(['forced_login', 'paths'])); $this->forcedLoginPaths->validateConfigurationForm($form, $condition_values); $ssl_verification_method = $form_state->getValue(['server', 'verify']); $cert_path = $form_state->getValue(['server', 'cert']); if ($ssl_verification_method == CasHelper::CA_CUSTOM && !file_exists($cert_path)) { $form_state->setErrorByName('server][cert', $this->t('The path you provided to the custom PEM certificate for your CAS server does not exist or is not readable. Verify this path and try again.')); } return parent::validateForm($form, $form_state); }