You are here

protected function Authorize::buildFormConfirmation in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Form/Authorize.php \Drupal\drd_agent\Form\Authorize::buildFormConfirmation()

Build the authorization confirmation form.

Parameters

array $form: The form array.

Return value

array The form.

1 call to Authorize::buildFormConfirmation()
Authorize::buildForm in src/Form/Authorize.php
Form constructor.

File

src/Form/Authorize.php, line 80

Class

Authorize
Authorize a new dashboard for this drd-agent.

Namespace

Drupal\drd_agent\Form

Code

protected function buildFormConfirmation(array $form) : array {
  if ($domain = $this->setupService
    ->getDomain()) {
    $form['attention'] = [
      '#markup' => t('You are about to grant admin access to the Drupal Remote Dashboard on the following domain:'),
      '#prefix' => '<div>',
      '#suffix' => '</div>',
    ];
    $form['domain'] = [
      '#markup' => $domain,
      '#prefix' => '<div class="domain">',
      '#suffix' => '</div>',
    ];
    $form['cancel'] = [
      '#type' => 'submit',
      '#value' => t('Cancel'),
    ];
    $form['submit'] = [
      '#type' => 'submit',
      '#value' => t('Grant admin access'),
    ];
  }
  else {
    unset($_SESSION['drd_agent_authorization_values']);
    $form = $this
      ->buildFormToken($form);
  }
  return $form;
}