Giter Club home page Giter Club logo

userpasswordlostbundle's Introduction

Installation

NOTE: The bundle is compatible with Symfony 3.0 upwards.

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

"require": {
    "inem0o/user-password-lost-bundle": "dev-master"
}

2 . Configure kernel:

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

3 . Configure bundle :

# app/config/config.yml
  user_password_lost:
      user_repo_name: "AppBundle:User"
      user_email_column_name: "email"

      email_from: "[email protected]"

      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 :

# app/config/routing.yml
user_password_lost:
  resource: "@UserPasswordLostBundle/Resources/config/routing.yml"
  prefix:   /

4 . Override templates :

Copy all templates from

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

into the folder

./app/Resources/UserPasswordLostBundle/views

5 . Override translations :

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.

Example : (Considering you named your event PasswordResetSuccessListener and your callback method onSuccessfulReset)

# 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 }

userpasswordlostbundle's People

Contributors

cymo-tgillet avatar inem0o avatar tg-cbnmc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.