public static function checkRestrictedAccess($route)
    {
        Logger::log('Checking admin zone');
        //Chequeamos si entramos en el admin
        if (!Config::getInstance()->checkTryToSaveConfig()
            && (preg_match('/^\/(admin|setup\-admin)/i', $route) || Config::getParam('restricted', false))
        ) {
            if (!self::isTest() &&
                null === Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json', Cache::JSONGZ, true)) {
                throw new AdminCredentialsException();
            }
            if (!Security::getInstance()->checkAdmin()) {
                throw new AccessDeniedException();
            }
            Logger::log('Admin access granted');
        }
    }
public static function checkRestrictedAccess($route)
    {
        Logger::log('Checking admin zone');
        //Chequeamos si entramos en el admin
        if (!Config::getInstance()->checkTryToSaveConfig()
            && (preg_match('/^\/(admin|setup\-admin)/i', $route) || Config::getParam('restricted', false))
        ) {
            if (!self::isTest() &&
                null === Cache::getInstance()->getDataFromFile(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json', Cache::JSONGZ, true)) {
                throw new AdminCredentialsException();
            }
            if (!Security::getInstance()->checkAdmin()) {
                throw new AccessDeniedException();
            }
            Logger::log('Admin access granted');
        }
    }
public static function checkRestrictedAccess ( $ route ) { Logger :: log ( 'Checking admin zone' ) ; //Chequeamos si entramos en el admin if ( ! Config :: getInstance ( ) -> checkTryToSaveConfig ( ) && ( preg_match ( '/^\/(admin|setup\-admin)/i' , $ route ) || Config :: getParam ( 'restricted' , false ) ) ) { if ( ! self :: isTest ( ) && null === Cache :: getInstance ( ) -> getDataFromFile ( CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json' , Cache :: JSONGZ , true ) ) { throw new AdminCredentialsException ( ) ; } if ( ! Security :: getInstance ( ) -> checkAdmin ( ) ) { throw new AccessDeniedException ( ) ; } Logger :: log ( 'Admin access granted' ) ; } }
Method that checks the access to the restricted zone

@param string $route

@throws AccessDeniedException
@throws AdminCredentialsException
Method that checks the access to the restricted zone