public function checkMaintenanceMode()
    {
        if (option('site_maintenance') &&
            !$this->request->isUserAdmin() &&
            !in_array(strtolower("{$this->request->plugin}:{$this->request->controller}:{$this->request->action}"), ['user:gateway:login', 'user:gateway:logout'])
        ) {
            $allowedIps = (array)array_filter(array_map('trim', explode(',', option('site_maintenance_ip'))));
            if (!in_array(env('REMOTE_ADDR'), $allowedIps)) {
                throw new SiteUnderMaintenanceException(option('site_maintenance_message'));
            }
        }
    }
public function checkMaintenanceMode()
    {
        if (option('site_maintenance') &&
            !$this->request->isUserAdmin() &&
            !in_array(strtolower("{$this->request->plugin}:{$this->request->controller}:{$this->request->action}"), ['user:gateway:login', 'user:gateway:logout'])
        ) {
            $allowedIps = (array)array_filter(array_map('trim', explode(',', option('site_maintenance_ip'))));
            if (!in_array(env('REMOTE_ADDR'), $allowedIps)) {
                throw new SiteUnderMaintenanceException(option('site_maintenance_message'));
            }
        }
    }
public function checkMaintenanceMode ( ) { if ( option ( 'site_maintenance' ) && ! $ this -> request -> isUserAdmin ( ) && ! in_array ( strtolower ( "{$this->request->plugin}:{$this->request->controller}:{$this->request->action}" ) , [ 'user:gateway:login' , 'user:gateway:logout' ] ) ) { $ allowedIps = ( array ) array_filter ( array_map ( 'trim' , explode ( ',' , option ( 'site_maintenance_ip' ) ) ) ) ; if ( ! in_array ( env ( 'REMOTE_ADDR' ) , $ allowedIps ) ) { throw new SiteUnderMaintenanceException ( option ( 'site_maintenance_message' ) ) ; } } }
Checks if maintenance is enabled, and renders the corresponding maintenance
message.

Login & logout sections of the site still working even on maintenance mode,
administrators can access the whole site as well.

@return void
@throws CMS\Error\SiteUnderMaintenanceException When site is under
maintenance mode
Checks if maintenance is enabled and renders the corresponding maintenance message .