classes/BearCMS.php
public function disabledCheck(): ?\BearFramework\App\Response
    {
        $currentUserExists = Config::hasServer() && (Config::hasFeature('USERS') || Config::hasFeature('USERS_LOGIN_*')) ? $this->currentUser->exists() : false;
        $settings = $this->app->bearCMS->data->settings->get();
        $isDisabled = !$currentUserExists && $settings->disabled;
        if ($isDisabled) {
            return new App\Response\TemporaryUnavailable(htmlspecialchars($settings->disabledText));
        }
        return null;
    }
public function disabledCheck(): ?\BearFramework\App\Response
    {
        $currentUserExists = Config::hasServer() && (Config::hasFeature('USERS') || Config::hasFeature('USERS_LOGIN_*')) ? $this->currentUser->exists() : false;
        $settings = $this->app->bearCMS->data->settings->get();
        $isDisabled = !$currentUserExists && $settings->disabled;
        if ($isDisabled) {
            return new App\Response\TemporaryUnavailable(htmlspecialchars($settings->disabledText));
        }
        return null;
    }
public function disabledCheck ( ) : ? \ BearFramework \ App \ Response { $ currentUserExists = Config :: hasServer ( ) && ( Config :: hasFeature ( 'USERS' ) || Config :: hasFeature ( 'USERS_LOGIN_*' ) ) ? $ this -> currentUser -> exists ( ) : false ; $ settings = $ this -> app -> bearCMS -> data -> settings -> get ( ) ; $ isDisabled = ! $ currentUserExists && $ settings -> disabled ; if ( $ isDisabled ) { return new App \ Response \ TemporaryUnavailable ( htmlspecialchars ( $ settings -> disabledText ) ) ; } return null ; }
A middleware to be used in routes that returns a temporary unavailable response if an administrator has disabled the app.

@return \BearFramework\App\Response|null
A middleware to be used in routes that returns a temporary unavailable response if an administrator has disabled the app .