A CP extension for basic ip block-list entries.
If you're looking for examples for plugin migrations, or CP forms, this might help you out as well.
The developer is responsible for grafting this to their frontend utilizing the variable or service.
This plugin requires Craft CMS 3.0.0-beta.23 or later.
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 /block-list
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Block List.
- Alternatively, from the project root-
php craft plugin/install block-list
- Alternatively, from the project root-
This plugin provides a simple Create, Read, Update, and Delete (CRUD) interface for managing block-listed IP addresses.
The usage of this functionality is up to the developer, it is not, by default, plugged into any Craft authentication mechanisms.
The default install file contains some entries already.
No configuration is needed beyond adding your Site License(s) and their related IP entries.
After installation a new CP area 'Block List' will be available.
Inside this area you can Create Site Licenses, which then present you with detail fields for that license.
In addition, each license can hold any number of IP addresses associated with it.
Currently the License details do not play a roll in authenticating IPs. ie any IP in any license is blocked, or allowed depending on how you implement this.
This functionality may change with future releases.
Once there are IP entries associated with a License, from any template you can authenticate an IP via:
craft.blockList.auth($ip)
The 'blockList' variable is available to create licenses and entries programmatically as well.
To use the plugin in PHP:
$authenticated = BlockList::$plugin->blockListService->authenticate($ip);
Some things to do, and ideas for potential features:
- Release it
- Improve it
- Use it
Brought to you by Benjamin Williamson