You are here

public function CasUserInteractionTestForm::submitForm in CAS 8

Same name and namespace in other branches
  1. 2.x tests/modules/cas_user_interaction_test/src/CasUserInteractionTestForm.php \Drupal\cas_user_interaction_test\CasUserInteractionTestForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormInterface::submitForm

File

tests/modules/cas_user_interaction_test/src/CasUserInteractionTestForm.php, line 33

Class

CasUserInteractionTestForm
Form that enforces the user to accept the new site's 'Legal Notice'.

Namespace

Drupal\cas_user_interaction_test

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  /** @var \Drupal\cas\Service\CasUserManager $cas_user_manager */
  $cas_user_manager = \Drupal::service('cas.user_manager');

  /** @var \Drupal\Core\TempStore\PrivateTempStore $tempstore */
  $tempstore = \Drupal::service('tempstore.private')
    ->get('cas_user_interaction_test');
  $cas_user_manager
    ->login($tempstore
    ->get('property_bag'), $tempstore
    ->get('ticket'));
  $form_state
    ->setRedirectUrl(Url::fromUserInput('/'));
}