You are here

public function SamlauthAuthmapDeleteForm::getQuestion in SAML Authentication 8.3

Same name and namespace in other branches
  1. 4.x src/Form/SamlauthAuthmapDeleteForm.php \Drupal\samlauth\Form\SamlauthAuthmapDeleteForm::getQuestion()

Returns the question to ask the user.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form question. The page title will be set to this value.

Overrides ConfirmFormInterface::getQuestion

File

src/Form/SamlauthAuthmapDeleteForm.php, line 73

Class

SamlauthAuthmapDeleteForm
Confirm the user wants to delete an authmap entry.

Namespace

Drupal\samlauth\Form

Code

public function getQuestion() {
  if (!empty($this->authmapEntry['uid'])) {

    /** @var \Drupal\user\Entity\User $user */
    $user = $this->entityTypeManager
      ->getStorage('user')
      ->load($this->authmapEntry['uid']);
  }
  return $this
    ->t('Are you sure you want to delete the link between login ID %id and Drupal user %user?', [
    '%id' => $this->authmapEntry['authname'],
    '%user' => isset($user) ? $user
      ->getAccountName() : "<unknown> ({$this->authmapEntry['uid']})",
  ]);
}