2017 © Pedro Peláez
 

library nette-identity-registration

Identity registration extension for Nette Framework

image

geniv/nette-identity-registration

Identity registration extension for Nette Framework

  • Tuesday, April 17, 2018
  • by geniv
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Identity registration

Installation

$ composer require geniv/nette-identity-registration

or, (*1)

"geniv/nette-identity-registration": ">=1.0.0"

require:, (*2)

"php": ">=7.0.0",
"nette/nette": ">=2.4.0",
"geniv/nette-general-form": ">=1.0.0"

Include in application

CleanUserEvent & ApproveLinkEvent validate parameter format: http://php.net/manual/en/function.strtotime.php, (*3)

ApproveLinkEvent destination parameter is string for $presenter->link(), (*4)

neon configure:, (*5)

# identity registration
identityRegistration:
#   autowired: true
#   formContainer: Identity\Registration\FormContainer
    events:
        - Identity\Events\CleanUserEvent(-14 days)              # clean non active user
        - CallbackEvent                                         # check duplicity
        - SetValueEvent([active: false, role: guest])           # default value for registration
        - Identity\Events\RegistrationEvent                     # core registration
        - Identity\Events\ApproveLinkEvent(+1 hour, //link)     # generate approve link
        admin: Identity\Events\EmailNotifyEvent                 # email for admin
        user: Identity\Events\EmailNotifyEvent                  # email for user

neon configure extension:, (*6)

extensions:
    identityRegistration: Identity\Registration\Bridges\Nette\Extension

presenter usage:, (*7)

protected function createComponentIdentityRegistration(RegistrationForm $registrationForm): RegistrationForm
{
    //$registrationForm->setTemplatePath(__DIR__ . '/templates/RegistrationForm.latte');
    $registrationForm->onSuccess[] = function (array $values) {
        $this->flashMessage('Registration!', 'info');
        $this->redirect('this');
    };
    $registrationForm->onException[] = function (RegistrationException $e) {
        $this->flashMessage('Registration exception! ' . $e->getMessage(), 'danger');
        $this->redirect('this');
    };
    return $registrationForm;
}

approve usage:, (*8)

public function actionApprove($h)
{
    try {
        if ($this->identityModel->processApprove($h)) {
            $this->flashMessage('Approve!', 'info');
        }
    } catch (IdentityException $e) {
        $this->flashMessage('Approve exception! ' . $e->getMessage(), 'danger');
    }
    $this->redirect('default');
}

latte usage:, (*9)

{control identityRegistration}

The Versions

17/04 2018

dev-master

9999999-dev

Identity registration extension for Nette Framework

  Sources   Download

MIT

The Requires

 

by Radek Frystak

registration user nette identity geniv

17/04 2018

v1.0.0

1.0.0.0

Identity registration extension for Nette Framework

  Sources   Download

MIT

The Requires

 

by Radek Frystak

registration user nette identity geniv

17/04 2018

dev-develop

dev-develop

Identity registration extension for Nette Framework

  Sources   Download

MIT

The Requires

 

by Radek Frystak

registration user nette identity geniv