You are here

public function LogintobogganProfileForm::validateForm in LoginToboggan 8

Validate form.

Overrides ContentEntityForm::validateForm

File

src/Form/LogintobogganProfileForm.php, line 80

Class

LogintobogganProfileForm
LogintobogganProfileForm.

Namespace

Drupal\logintoboggan\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $trusted_role = LogintobogganUtility::trustedRole();
  $account = $form_state
    ->getFormObject()
    ->getEntity();
  $trusted = $account
    ->hasRole($trusted_role) ? '1' : '0';
  $form_state
    ->addBuildInfo('logintoboggan_trusted', $trusted);
  parent::validateForm($form, $form_state);
}