You are here

public function LogintobogganController::logintobogganResendValidation in LoginToboggan 8

This will return the output of the page.

1 string reference to 'LogintobogganController::logintobogganResendValidation'
logintoboggan.routing.yml in ./logintoboggan.routing.yml
logintoboggan.routing.yml

File

src/Controller/LogintobogganController.php, line 124

Class

LogintobogganController
Class LogintobogganController.

Namespace

Drupal\logintoboggan\Controller

Code

public function logintobogganResendValidation($user) {
  $account = user::load($user);
  _user_mail_notify('register_no_approval_required', $account);

  // Notify admin or user that e-mail was sent and return to user edit form.
  if ($this
    ->currentUser()
    ->hasPermission('administer users')) {
    $this
      ->messenger()
      ->addMessage($this
      ->t("A validation e-mail has been sent to the user's e-mail address."));
  }
  else {
    $this
      ->messenger()
      ->addMessage($this
      ->t('A validation e-mail has been sent to your e-mail address. You will need to follow the instructions in that message in order to gain full access to the site.'));
  }
  return new RedirectResponse(URL::fromRoute('entity.user.edit_form', [
    'user' => $user,
  ])
    ->toString());
}