Loading src/EventSubscriber/PasswordPolicyEventSubscriber.php +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ class PasswordPolicyEventSubscriber implements EventSubscriberInterface { $url = new Url('entity.user.edit_form', ['user' => $user->id()]); $url = $url->setAbsolute(TRUE)->toString(); $event->setResponse(new RedirectResponse($url)); drupal_set_message(t('Your password has expired, please update it'), 'error'); \Drupal::messenger()->addError('Your password has expired, please update it'); } } } Loading src/Form/PasswordPolicyDeleteForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class PasswordPolicyDeleteForm extends EntityConfirmFormBase { public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); drupal_set_message( $this->messenger()->addMessage( $this->t('The @label password policy has been deleted.', [ '@type' => $this->entity->bundle(), Loading src/Form/PasswordPolicyRolesForm.php +3 −3 Original line number Diff line number Diff line Loading @@ -24,9 +24,9 @@ class PasswordPolicyRolesForm extends FormBase { * {@inheritdoc} */ public static function create(ContainerInterface $container) { /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ $entity_manager = $container->get('entity.manager'); return new static($entity_manager->getStorage('user_role')); /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ $entity_type_manager = $container->get('entity_type.manager'); return new static($entity_type_manager->getStorage('user_role')); } /** Loading src/Form/PasswordReset.php +5 −5 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ class PasswordReset extends FormBase { * {@inheritdoc} */ public static function create(ContainerInterface $container) { /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ $entity_manager = $container->get('entity.manager'); return new static($entity_manager->getStorage('user_role'), $entity_manager->getStorage('user')); /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ $entity_type_manager = $container->get('entity_type.manager'); return new static($entity_type_manager->getStorage('user_role'), $entity_type_manager->getStorage('user')); } /** Loading Loading @@ -116,7 +116,7 @@ class PasswordReset extends FormBase { $user->save(); } drupal_set_message( $this->messenger()->addMessage( $this->formatPlural( count($roles), 'Reset the %roles role.', Loading @@ -126,7 +126,7 @@ class PasswordReset extends FormBase { ); } else { drupal_set_message($this->t('No roles selected.'), 'warning'); $this->messenger()->addWarning($this->t('No roles selected.')); } $form_state->setRedirectUrl(new Url('entity.password_policy.collection')); Loading src/PasswordConstraintInterface.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ namespace Drupal\password_policy; use Drupal\Component\Plugin\ConfigurablePluginInterface; use Drupal\Component\Plugin\ConfigurableInterface; use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Core\Plugin\PluginFormInterface; /** * An interface to define the expected operations of a password constraint. */ interface PasswordConstraintInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface { interface PasswordConstraintInterface extends PluginInspectionInterface, ConfigurableInterface, PluginFormInterface { /** * Returns a true/false status if the password meets the constraint. Loading Loading
src/EventSubscriber/PasswordPolicyEventSubscriber.php +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ class PasswordPolicyEventSubscriber implements EventSubscriberInterface { $url = new Url('entity.user.edit_form', ['user' => $user->id()]); $url = $url->setAbsolute(TRUE)->toString(); $event->setResponse(new RedirectResponse($url)); drupal_set_message(t('Your password has expired, please update it'), 'error'); \Drupal::messenger()->addError('Your password has expired, please update it'); } } } Loading
src/Form/PasswordPolicyDeleteForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ class PasswordPolicyDeleteForm extends EntityConfirmFormBase { public function submitForm(array &$form, FormStateInterface $form_state) { $this->entity->delete(); drupal_set_message( $this->messenger()->addMessage( $this->t('The @label password policy has been deleted.', [ '@type' => $this->entity->bundle(), Loading
src/Form/PasswordPolicyRolesForm.php +3 −3 Original line number Diff line number Diff line Loading @@ -24,9 +24,9 @@ class PasswordPolicyRolesForm extends FormBase { * {@inheritdoc} */ public static function create(ContainerInterface $container) { /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ $entity_manager = $container->get('entity.manager'); return new static($entity_manager->getStorage('user_role')); /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ $entity_type_manager = $container->get('entity_type.manager'); return new static($entity_type_manager->getStorage('user_role')); } /** Loading
src/Form/PasswordReset.php +5 −5 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ class PasswordReset extends FormBase { * {@inheritdoc} */ public static function create(ContainerInterface $container) { /** @var \Drupal\Core\Entity\EntityManagerInterface $entity_manager */ $entity_manager = $container->get('entity.manager'); return new static($entity_manager->getStorage('user_role'), $entity_manager->getStorage('user')); /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */ $entity_type_manager = $container->get('entity_type.manager'); return new static($entity_type_manager->getStorage('user_role'), $entity_type_manager->getStorage('user')); } /** Loading Loading @@ -116,7 +116,7 @@ class PasswordReset extends FormBase { $user->save(); } drupal_set_message( $this->messenger()->addMessage( $this->formatPlural( count($roles), 'Reset the %roles role.', Loading @@ -126,7 +126,7 @@ class PasswordReset extends FormBase { ); } else { drupal_set_message($this->t('No roles selected.'), 'warning'); $this->messenger()->addWarning($this->t('No roles selected.')); } $form_state->setRedirectUrl(new Url('entity.password_policy.collection')); Loading
src/PasswordConstraintInterface.php +2 −2 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ namespace Drupal\password_policy; use Drupal\Component\Plugin\ConfigurablePluginInterface; use Drupal\Component\Plugin\ConfigurableInterface; use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Core\Plugin\PluginFormInterface; /** * An interface to define the expected operations of a password constraint. */ interface PasswordConstraintInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface { interface PasswordConstraintInterface extends PluginInspectionInterface, ConfigurableInterface, PluginFormInterface { /** * Returns a true/false status if the password meets the constraint. Loading