PHP code example of superbig / craft3-restrict

1. Go to this page and download the library: Download superbig/craft3-restrict library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

superbig / craft3-restrict example snippets



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
];