superbig / craft3-restrict
Restrict access to the CP based on a IP whitelist
Installs: 8 867
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 2
Open Issues: 4
Type:craft-plugin
Requires
- craftcms/cms: ^3.0.0
- dxw/cidr: ^3.0
This package is auto-updated.
Last update: 2022-07-14 19:26:38 UTC
README
Note: This plugin has been abandoned. Use Knock Knock as an alternative.
Restrict plugin for Craft CMS 3.x
Restrict access to the CP based on a IP whitelist
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require superbig/craft3-restrict
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Restrict.
Configuring Restrict
<?php return [ 'enabled' => true, // Add any IPs you want to be able to access the CP. You can also use CIDR notation such as 192.168.0.0/24 'ipWhitelist' => [ '::1', '127.0.0.1' ], // Logged in admins can bypass the whitelist 'allowAdmins' => true, // By default, the plugin will throw a exception if the IP isn't in the whitelist // If you want to redirect to an url instead, set it here 'redirectUrl' => null, // Or you want to render a template, set it here 'template' => null ];
Using Restrict
- Copy the sample config file
restrict.php
into Craft's config folder, by defaultcraft/config
. - Add the IPs you want to allow access to the CP, and change the other settings as you see fit.
Brought to you by Superbig