2017 © Pedro PelĂĄez
 

symfony-bundle user-password-lost-bundle

A user password recovery bundle for Symfony3

image

inem0o/user-password-lost-bundle

A user password recovery bundle for Symfony3

  • Wednesday, January 18, 2017
  • by iNem0o
  • Repository
  • 2 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Installation

NOTE: The bundle is compatible with Symfony 3.0 upwards., (*1)

1 . Download this bundle to your project first. The preferred way to do it is to use Composer package manager:, (*2)

``` json "require": { "inem0o/user-password-lost-bundle": "dev-master" }, (*3)


2 . Configure kernel: ``` php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new inem0o\UserPasswordLostBundle\UserPasswordLostBundle(), // ... ); }

3 . Configure bundle :, (*4)

``` yaml, (*5)

app/config/config.yml

user_password_lost: user_repo_name: "AppBundle:User" user_email_column_name: "email", (*6)

  email_from: "contact@site.net"

  route_to_redirect_on_failure: "homepage"
  route_to_redirect_on_success: "login"

  display_success_flashbag: true

  forms:
        constraints:
                - {form_name: form_password_request, field: user_email, class: Symfony\Component\Validator\Constraints\NotBlank, params: {message: 'Email field cannot be blank'}}

4 . Configure routes : ``` yaml # app/config/routing.yml user_password_lost: resource: "@UserPasswordLostBundle/Resources/config/routing.yml" prefix: /

4 . Override templates :, (*7)

Copy all templates from

./vendor/inem0o/user-password-lost-bundle/inem0o/UserPasswordLostBundle/Resources/views/*

into the folder

./app/Resources/UserPasswordLostBundle/views

5 . Override translations :, (*8)

Copy all translation files from

./vendor/inem0o/user-password-lost-bundle/inem0o/UserPasswordLostBundle/Resources/translations/userPasswordLostBundle.*.xliff

into the folder

./app/Resources/translations/userPasswordLostBundle.*.xliff

Events

The UserPasswordLostBundle dispatches an event when the reset has been successful : inem0o.userpasswordlostbundle.successful_reset The event contains the user who requested a new password, accessible with a $event->getUser() getter. You have to register a listener in order to catch it., (*9)

Example : (Considering you named your event PasswordResetSuccessListener and your callback method onSuccessfulReset) ``` yaml, (*10)

src/Acme/AppBundle/Resources/config/services.yml

acme.user.reset_password_success.listener: class: Acme\AppBundle\EventListener\PasswordResetSuccessListener tags: - { name: kernel.event_listener, event: inem0o.userpasswordlostbundle.successful_reset, method: onSuccessfulReset } ```, (*11)

The Versions

18/01 2017

dev-master

9999999-dev https://paradise.inem0o.fr:65253/inem0o/UserPasswordLostBundle

A user password recovery bundle for Symfony3

  Sources   Download

MIT

The Requires

 

by Léo Cunéaz

symfony

18/01 2017

1.0.1

1.0.1.0 https://paradise.inem0o.fr:65253/inem0o/UserPasswordLostBundle

A user password recovery bundle for Symfony3

  Sources   Download

MIT

The Requires

 

by Léo Cunéaz

symfony

20/11 2016

v1.0

1.0.0.0 https://paradise.inem0o.fr:65253/inem0o/UserPasswordLostBundle

A user password recovery bundle for Symfony3

  Sources   Download

MIT

The Requires

 

by Léo Cunéaz

symfony