function user_registrationpassword_set_message in User registration password 8
Same name and namespace in other branches
- 7 user_registrationpassword.module \user_registrationpassword_set_message()
Simple message and redirect.
Parameters
string $type: The type of message.
string $redirect: The redirect route.
Return value
string The redirect route name.
Deprecated
from 8.x-1.0-beta1 and dropped in 8.x-1.0. Use the drupal core messenger service instead.
File
- ./
user_registrationpassword.module, line 397 - Enables password creation on registration form.
Code
function user_registrationpassword_set_message($type = 'welcome', $redirect = '') {
@trigger_error('user_registrationpassword_set_message() is deprecated in 8.x-1.0-beta1 and is removed in version 8.x-1.0 - Use the Drupal core messenger service instead.', E_USER_DEPRECATED);
$route_name = '';
// Select what message to display.
switch ($type) {
case 'linkerror':
\Drupal::messenger()
->addStatus(t('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.'));
// Redirect to user/pass.
if (!empty($redirect)) {
$route_name = 'user.pass';
}
break;
case 'welcome':
\Drupal::messenger()
->addStatus(t('Further instructions have been sent to your email address.'));
// Redirect to front.
if (!empty($redirect)) {
$route_name = '<front>';
}
break;
}
return $route_name;
}