src/Security/BasicAuth.php
public static function protect_entire_site($protect = true, $code = self::AUTH_PERMISSION, $message = null)
    {
        static::config()
            ->set('entire_site_protected', $protect)
            ->set('entire_site_protected_code', $code);
        if ($message) {
            static::config()->set('entire_site_protected_message', $message);
        }
    }
public static function protect_entire_site($protect = true, $code = self::AUTH_PERMISSION, $message = null)
    {
        static::config()
            ->set('entire_site_protected', $protect)
            ->set('entire_site_protected_code', $code);
        if ($message) {
            static::config()->set('entire_site_protected_message', $message);
        }
    }
public static function protect_entire_site ( $ protect = true , $ code = self :: AUTH_PERMISSION , $ message = null ) { static :: config ( ) -> set ( 'entire_site_protected' , $ protect ) -> set ( 'entire_site_protected_code' , $ code ) ; if ( $ message ) { static :: config ( ) -> set ( 'entire_site_protected_message' , $ message ) ; } }
Enable protection of the entire site with basic authentication.

This log-in uses the Member database for authentication, but doesn't interfere with the
regular log-in form. This can be useful for test sites, where you want to hide the site
away from prying eyes, but still be able to test the regular log-in features of the site.

You can also enable this feature by adding this line to your .env. Set this to a permission
code you wish to require.

SS_USE_BASIC_AUTH=ADMIN

@param boolean $protect Set this to false to disable protection.
@param string $code {@link Permission} code that is required from the user.
Defaults to "ADMIN". Set to NULL to just require a valid login, regardless
of the permission codes a user has.
@param string $message
Enable protection of the entire site with basic authentication .