2017 © Pedro Peláez
 

library security

Add ability to use more authentifications in same time in your Nette Framework project

image

holabs/security

Add ability to use more authentifications in same time in your Nette Framework project

  • Wednesday, June 20, 2018
  • by holantomas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 113 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 14 % Grown

The README.md

Holabs/Security

Adding ability for use more authentication methods a.k.a basic form, facebook and google in same time. THIS package contains only basic form., (*1)

Installation

Requirements: - php 5.6+ - Holabs/UI - nette/di - nette/utils, (*2)

composer require holabs/security

Configuration

security: Holabs\Security\Bridges\Nette\SecurityExtension

security:
    authenticators:
        basic: Holabs\Security\Authenticators\Basic
#       auth_name: authenticator\class

In authenticators you can define all your authenticators. Name is used for component., (*3)

Using

Your SignPresenter now can looks like this:, (*4)

<?php 

use Holabs\Security\Container;
use Nette\Application\UI\Presenter;
use Nette\Application\UI\Multiplier;

/**
 * @author       Tomáš Holan <mail@tomasholan.eu>, D-Music s.r.o. [www.d-music.cz]
 * @package      holabs/security
 * @copyright    Copyright © 2016, D-Music s.r.o. [www.d-music.cz]
 */
class SignPresenter extends Presenter {

    /** @var Container @inject */
    public $container;

    public function renderIn(){
        $this->template->authenticators = $this->container->getAuthenticators();
    }

    /**
     * @return Multiplier
     */
    protected function createComponentLogin(){
        return new Multiplier(function($name) {

            return $this->container->getAuthenticator($name);

        });
    }
}

No you can render what you want. You can render all in in.latte, (*5)

<div n:inner-foreach="$authenticators as $name => $authenticator">
    {control $authenticator}
    {*control $authenticators-{$name}*}
</div>

OR only which you want(authenticator name is same as you define in config file), (*6)

<div>
    {control $authenticators-basic}
</div>

The Versions

20/06 2018

dev-master

9999999-dev

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

20/06 2018

v1.0.9

1.0.9.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

04/06 2018

v1.0.8

1.0.8.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

04/06 2018

v1.0.7

1.0.7.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

04/06 2018

v1.0.6

1.0.6.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

22/11 2017

1.0.5

1.0.5.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

14/11 2017

1.0.4

1.0.4.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

13/11 2017

1.0.3

1.0.3.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

01/11 2017

1.0.2

1.0.2.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

01/11 2017

1.0.1

1.0.1.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

20/02 2017

1.0.0

1.0.0.0

Add ability to use more authentifications in same time in your Nette Framework project

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires