X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fuser%2Fsrc%2FRegisterForm.php;fp=web%2Fcore%2Fmodules%2Fuser%2Fsrc%2FRegisterForm.php;h=18760f4d4ccdf63ef612d1b2463a3083d42f3d05;hp=4974e69d8d6028ae9f630da212b3459efce37117;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/user/src/RegisterForm.php b/web/core/modules/user/src/RegisterForm.php index 4974e69d8..18760f4d4 100644 --- a/web/core/modules/user/src/RegisterForm.php +++ b/web/core/modules/user/src/RegisterForm.php @@ -103,28 +103,28 @@ class RegisterForm extends AccountForm { // New administrative account without notification. if ($admin && !$notify) { - drupal_set_message($this->t('Created a new user account for %name. No email has been sent.', [':url' => $account->url(), '%name' => $account->getUsername()])); + $this->messenger()->addStatus($this->t('Created a new user account for %name. No email has been sent.', [':url' => $account->url(), '%name' => $account->getUsername()])); } // No email verification required; log in user immediately. elseif (!$admin && !\Drupal::config('user.settings')->get('verify_mail') && $account->isActive()) { _user_mail_notify('register_no_approval_required', $account); user_login_finalize($account); - drupal_set_message($this->t('Registration successful. You are now logged in.')); + $this->messenger()->addStatus($this->t('Registration successful. You are now logged in.')); $form_state->setRedirect(''); } // No administrator approval required. elseif ($account->isActive() || $notify) { if (!$account->getEmail() && $notify) { - drupal_set_message($this->t('The new user %name was created without an email address, so no welcome message was sent.', [':url' => $account->url(), '%name' => $account->getUsername()])); + $this->messenger()->addStatus($this->t('The new user %name was created without an email address, so no welcome message was sent.', [':url' => $account->url(), '%name' => $account->getUsername()])); } else { $op = $notify ? 'register_admin_created' : 'register_no_approval_required'; if (_user_mail_notify($op, $account)) { if ($notify) { - drupal_set_message($this->t('A welcome message with further instructions has been emailed to the new user %name.', [':url' => $account->url(), '%name' => $account->getUsername()])); + $this->messenger()->addStatus($this->t('A welcome message with further instructions has been emailed to the new user %name.', [':url' => $account->url(), '%name' => $account->getUsername()])); } else { - drupal_set_message($this->t('A welcome message with further instructions has been sent to your email address.')); + $this->messenger()->addStatus($this->t('A welcome message with further instructions has been sent to your email address.')); $form_state->setRedirect(''); } } @@ -133,7 +133,7 @@ class RegisterForm extends AccountForm { // Administrator approval required. else { _user_mail_notify('register_pending_approval', $account); - drupal_set_message($this->t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your email address.')); + $this->messenger()->addStatus($this->t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your email address.')); $form_state->setRedirect(''); } }