Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heimrichhannot/contao-backend-lost-password-bundle

This bundle offers a lost password function for the backend of the Contao CMS.
https://github.com/heimrichhannot/contao-backend-lost-password-bundle

Last synced: about 1 month ago
JSON representation

This bundle offers a lost password function for the backend of the Contao CMS.

Awesome Lists containing this project

README

        

# Contao Backend Lost Password Bundle

This bundle offers a lost password function for the backend of the Contao CMS.

![alt preview](docs/lost-password.png)

## Features

- Never send new passwords to your customers again if they have forgotten their old ones. :-)
- After requesting a new password, a password reset link is sent to the user's email.
- Select a mailer transport for outgoing mails in the settings.

## Installation

1. Install via composer: `composer require heimrichhannot/contao-backend-lost-password-bundle` and update your database.
1. Set the `huh_backend_lost_password.add_to_template` to true if you want the lost password link automatically added to you backend login template.

```yaml
# config/config.yml
huh_backend_lost_password:
add_to_template: true
```

## Customize

### Use Notification center

You can use [Notification Center](https://github.com/terminal42/contao-notification_center) to send the password request.

1. Create a notification of type `User: Lost password` with `##recipient_email##` as recipient and content that contains `##link##` (the link to the password reset page).
You can use additional token: `##domain##` and user data withing `##user_*##`.
2. Set the id of the notification in your project configuration in `huh_backend_lost_password.nc_notification`.

```yaml
# config/config.yml
huh_backend_lost_password:
nc_notification: 5
```

### Usage in a custom template

You can insert the lost password link in a custom login template where you want by calling `BackendLostPasswortManager->getLostPasswordLink()`.

```


= $this->password ?>

= System::getContainer()->get(\HeimrichHannot\BackendLostPasswordBundle\Manager\BackendLostPasswordManager::class)->getLostPasswordLink() ?>


= $this->loginButton ?>
= $this->feLink ?> ›

```

### Adjust the email's text

**Hint: You can also set a notification center message by setting the id in your config.yml (see below).**

Simply override the following `$GLOBALS` entries:

```
$GLOBALS['TL_LANG']['MSC']['backendLostPassword']['messageSubjectResetPassword']
$GLOBALS['TL_LANG']['MSC']['backendLostPassword']['messageBodyResetPassword']
```

## Configuration reference

```yaml
# Default configuration for extension with alias: "huh_backend_lost_password"
huh_backend_lost_password:

# If true, that backend lost password link will be automatically added to the backed login template. Default false. Will be true in the next major version!
add_to_template: false

# The numeric ID of the notification center notification which is sent for resetting the password.
nc_notification: false
```