mipotech/yii2-devlogin

A package to password-protect an entire site, typically when in dev or test mode

Installs: 789

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 1

Open Issues: 0

Type:yii2-extension

1.2 2020-11-15 15:27 UTC

This package is auto-updated.

Last update: 2024-05-16 14:54:53 UTC


README

This package provides a simple way to password-protect an entire site, typically when in dev or test mode.

Installation

The preferred way to install this extension is through composer. Either run

php composer.phar require --prefer-dist mipotech/yii2-devlogin "*"

or add:

"mipotech/yii2-devlogin": "*",

to the require section of your composer.json file and perform a composer update.

Configuration

Add devlogin as an application component in @app/config/web.php:

'components' => [
    ...
    'devlogin' => [
        /* Required settings */
        'class' => 'mipotech\devlogin\Bootstrap',
        'username' => 'XXXXX',
        'password' => 'YYYYY',
        
        /* Optional settings */
        'environments' => ['dev'],    // defaults to ['dev', 'test']
        'excludeIPs' => ['192.168.10.1'],    // IP addresses to exclude from this rule. defaults to []
        'excludePaths' => ['/dashboard','/gii'],    // defaults to []
        'logoPath' => '/images/logo.png',
    ],
    ...
]

and then add the devlogin component in the bootstrap section of the config file:

'bootstrap' => [
    'log',
    'devlogin',
    ...
]

That's it. The package is set up and ready to go.