2017 © Pedro Peláez
 

yii2-extension yii2-confirmation

Allows the caching of a value and storing in a table to be approved at a later date

image

enigmatix/yii2-confirmation

Allows the caching of a value and storing in a table to be approved at a later date

  • Friday, March 31, 2017
  • by enigmatix
  • Repository
  • 2 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Latest Stable Version Latest Unstable Version Build Status Scrutinizer Code Quality License, (*1)

Confirmation Behavior

This behavior protects variable(s) in a model from being changed by sending a confirmation request via email. This is ideally used for secure information, such as email addresses connected to user accounts, where you want to ensure the user has access to the new email address before commiting the change., (*2)

Once a user attempts to change an email, the request and the object are stored, and the release token is sent either to the new email address, or if another attribute is changed, to the current email address of the user., (*3)

The functionality traverses the 'createdBy' link to the user's table. If no email is found in the model, and no email can be retrieved from the createdBy link, an exception will be thrown., (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Either run, (*6)

php composer.phar require --prefer-dist enigmatix/yii2-confirmation "*"

or add, (*7)

"enigmatix/yii2-confirmation": "*"

to the require section of your composer.json file., (*8)

Usage

Once the extension is installed:, (*9)

  1. Run the migration
./yii migrate --migrationPath=@vendor/enigmatix/yii2-confirmation/migration

  1. Add the behavior to the appropriate model.

Class User extends ActiveRecord { ... public function behaviors() { return [ ... [ 'class' => ConfirmationBehavior::className(), 'protectedAttributes' => ['email'], //your attribute name here //'allow' => ['roleA', ['roleB'] ], ]; } }

The 'allow' node is optional, and only required if you want certain roles to be excluded from generating a confirmation. Often useful for admin or other privileged users., (*10)

  1. Add the controller to your frontend or app config/main.php
return [
...
    'controllerMap' => [
        'confirmation-requests' => 'enigmatix\confirmation\ConfirmationRequestsController'
    ],
];

The Versions

31/03 2017

dev-master

9999999-dev

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joel Small

extension yii2

31/03 2017

1.1.1

1.1.1.0

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joel Small

extension yii2

31/03 2017

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joel Small

extension yii2

30/03 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joel Small

extension yii2

30/03 2017

1.1.0

1.1.0.0

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joel Small

extension yii2

29/03 2017

1.0.3

1.0.3.0

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joel Small

extension yii2

26/03 2017

1.0.2

1.0.2.0

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

by Joel Small

extension yii2

26/03 2017

1.0.1

1.0.1.0

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

by Joel Small

extension yii2

26/03 2017

1.0.0

1.0.0.0

Allows the caching of a value and storing in a table to be approved at a later date

  Sources   Download

MIT

The Requires

 

by Joel Small

extension yii2