/var/www/vhosts/emtbw.com/httpdocs/develop/system/Output/Output.php
$this->sendOutput(Theme::i()->getTemplate('global', 'core')->globalTemplate($title, Theme::i()->getTemplate('global', 'core')->error($title, $message, $code, $extra, $member, $faulty, $httpStatusCode), array('app' => Dispatcher::i()->application ? Dispatcher::i()->application->directory : NULL, 'module' => Dispatcher::i()->module ? Dispatcher::i()->module->key : NULL, 'controller' => Dispatcher::i()->controller)), $httpStatusCode, 'text/html', $httpHeaders, FALSE );
}
}
/**
* Send a header. This is abstracted in an effort to better isolate code for testing purposes.
*
* @param string $header Text to send as a fully formatted header string
* @return void
*/
public function sendHeader( string $header ) : void
{
/* If we are running our test suite, we don't want to send browser headers */
if( ENFORCE_ACCESS AND mb_strtolower( php_sapi_name() ) == 'cli' )
{
return;
}
header( $header );
}
/**
* Send a header. This is abstracted in an effort to better isolate code for testing purposes.
*
* @param int $httpStatusCode HTTP Status Code
* @return void
*/
public function sendStatusCodeHeader( int $httpStatusCode ) : void
{
/* Set HTTP status */
if( isset( $_SERVER['SERVER_PROTOCOL'] ) and strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) !== false )
{
$this->sendHeader( "HTTP/1.0 {$httpStatusCode} " . static::$httpStatuses[ $httpStatusCode ] );
}
else
{
$this->sendHeader( "HTTP/1.1 {$httpStatusCode} " . static::$httpStatuses[ $httpStatusCode ] );
}
}
/var/www/vhosts/emtbw.com/httpdocs/develop/system/Output/Output.php
$this->sendOutput(Theme::i()->getTemplate('global', 'core')->globalTemplate($title, Theme::i()->getTemplate('global', 'core')->error($title, $message, $code, $extra, $member, $faulty, $httpStatusCode), array('app' => Dispatcher::i()->application ? Dispatcher::i()->application->directory : NULL, 'module' => Dispatcher::i()->module ? Dispatcher::i()->module->key : NULL, 'controller' => Dispatcher::i()->controller)), $httpStatusCode, 'text/html', $httpHeaders, FALSE );
}
}
/**
* Send a header. This is abstracted in an effort to better isolate code for testing purposes.
*
* @param string $header Text to send as a fully formatted header string
* @return void
*/
public function sendHeader( string $header ) : void
{
/* If we are running our test suite, we don't want to send browser headers */
if( ENFORCE_ACCESS AND mb_strtolower( php_sapi_name() ) == 'cli' )
{
return;
}
header( $header );
}
/**
* Send a header. This is abstracted in an effort to better isolate code for testing purposes.
*
* @param int $httpStatusCode HTTP Status Code
* @return void
*/
public function sendStatusCodeHeader( int $httpStatusCode ) : void
{
/* Set HTTP status */
if( isset( $_SERVER['SERVER_PROTOCOL'] ) and strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) !== false )
{
$this->sendHeader( "HTTP/1.0 {$httpStatusCode} " . static::$httpStatuses[ $httpStatusCode ] );
}
else
{
$this->sendHeader( "HTTP/1.1 {$httpStatusCode} " . static::$httpStatuses[ $httpStatusCode ] );
}
}
/var/www/vhosts/emtbw.com/httpdocs/develop/system/Output/Output.php
header( $header );
}
/**
* Send a header. This is abstracted in an effort to better isolate code for testing purposes.
*
* @param int $httpStatusCode HTTP Status Code
* @return void
*/
public function sendStatusCodeHeader( int $httpStatusCode ) : void
{
/* Set HTTP status */
if( isset( $_SERVER['SERVER_PROTOCOL'] ) and strstr( $_SERVER['SERVER_PROTOCOL'], '/1.0' ) !== false )
{
$this->sendHeader( "HTTP/1.0 {$httpStatusCode} " . static::$httpStatuses[ $httpStatusCode ] );
}
else
{
$this->sendHeader( "HTTP/1.1 {$httpStatusCode} " . static::$httpStatuses[ $httpStatusCode ] );
}
}
/**
* Can this output be cached by CDN?
*
* @param string $contentType
* @param bool $checkCachePageTimeout
* @return bool
*/
public function isCacheable( string $contentType='text/html', bool $checkCachePageTimeout = true ): bool
{
/* Have we got a value for the default cache timeout? */
if ( $checkCachePageTimeout and ! \IPS\CACHE_PAGE_TIMEOUT )
{
return false;
}
/* Have we set a per-page cache timeout of false, which means we don't want to cache? */
if ( static::$cacheDate === false )
/var/www/vhosts/emtbw.com/httpdocs/develop/system/Output/Output.php
$output = str_replace( '<!--ipsVleWords-->', 'var ipsVle = ' . json_encode( Member::loggedIn()->language()->vleForJson(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS ) . ';', $output );
}
/* Check for any autosave cookies */
if ( count( Request::i()->clearAutoSaveCookie ) )
{
Request::i()->setCookie( 'clearAutosave', implode( ',', Request::i()->clearAutoSaveCookie ), NULL, FALSE );
}
/* Remove anything from the output buffer that should not be there as it can confuse content-length */
if( ob_get_length() )
{
@ob_end_clean();
}
/* Trim any blank spaces before the beginning of output */
$output = ltrim( $output );
/* Set HTTP status */
$this->sendStatusCodeHeader( $httpStatusCode );
/* Start buffering */
ob_start();
/* Generated by a logged in user? */
if( Dispatcher::hasInstance() )
{
$this->sendHeader( "X-IPS-LoggedIn: " . ( ( Member::loggedIn()->member_id ) ? 1 : 0 ) );
}
/* We want to vary on the cookie so that browser caches are not used when changing themes or languages */
$vary = array( 'Cookie' );
/* Can we compress the content? */
if ( $output and isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) )
{
/* If php zlib.output_compression is on, don't do anything since PHP will */
if( (bool) ini_get('zlib.output_compression') === false )
{
/* Try brotli first - support will be rare, but preferred if it is available */
/var/www/vhosts/emtbw.com/httpdocs/develop/system/Output/Output.php
}
else
{
if ( $message )
{
$message = Member::loggedIn()->language()->addToStack( $message );
Member::loggedIn()->language()->parseOutputForDisplay( $message );
static::setInlineMessage( $message );
session_write_close();
}
elseif( $this->inlineMessage )
{
static::setInlineMessage( $this->inlineMessage );
session_write_close();
}
/* Send location and no-cache headers to prevent redirects from being cached */
$headers = array_merge( array( "Location" => (string) $url ), Output::getNoCacheHeaders() );
$this->sendOutput('', $httpStatusCode, '', $headers);
}
}
/**
* Replace the {{fileStore.xxxxxx}} urls to the actual URLs
*
* @param string|null $output The compiled output
* @return void
*/
public function parseFileObjectUrls( ?string &$output ) : void
{
if ( stristr( $output, '<fileStore.' ) )
{
preg_match_all( '#<fileStore.([\d\w\_]+?)>#', $output, $matches, PREG_SET_ORDER );
foreach( $matches as $index => $data )
{
if ( isset( $data[1] ) )
{
if ( ! isset( static::$fileObjectClasses[ $data[1] ] ) )
/var/www/vhosts/emtbw.com/httpdocs/develop/system/Dispatcher/Front.php
}
if ( $ipBanned or $banEnd = Member::loggedIn()->isBanned() )
{
if ( !$ipBanned and !Member::loggedIn()->member_id )
{
if ( $this->notAllowedBannedPage() )
{
$url = Url::internal( 'app=core&module=system&controller=login', 'front', 'login' );
if ( Request::i()->url() != Settings::i()->base_url AND !isset( Request::i()->_mfaLogin ) )
{
$url = $url->setQueryString( 'ref', base64_encode( Request::i()->url() ) );
}
else if ( isset( Request::i()->_mfaLogin ) )
{
$url = $url->setQueryString( '_mfaLogin', 1 );
}
Output::i()->redirect( $url );
}
}
else
{
Output::i()->sidebar = [];
Output::i()->bodyClasses[] = 'ipsLayout_minimal';
if( !$this->application->allowBannedAccess( $this->module, $this->controller, Request::i()->do ?? null ) )
{
Output::i()->showBanned();
}
}
}
/* Do we need more info from the member or do they need to validate? */
if( Member::loggedIn()->member_id and !$this->application->skipDoMemberCheck( $this->module, $this->controller, Request::i()->do ?? null ) )
{
if ( $url = static::doMemberCheck() )
{
Output::i()->redirect( $url );
}
/var/www/vhosts/emtbw.com/httpdocs/develop/system/Dispatcher/Dispatcher.php
}
}
}
if( $_redirect === TRUE )
{
/* conf_global.php does not exist, forward to installer - we'll do this manually to avoid any code in Output.php that anticipates the installation already being complete (such as setting CSP header in __construct()) */
$url = ( Request::i()->isSecure() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . rtrim( dirname( $_SERVER['SCRIPT_NAME'] ), '/' );
header( "HTTP/1.1 307 Temporary Redirect" );
foreach(Output::getNoCacheHeaders() as $headerKey => $headerValue )
{
header( "{$headerKey}: {$headerValue}" );
}
header( "Location: {$url}/admin/install/" );
exit;
}
}
static::$instance->init();
}
return static::$instance;
}
/**
* @brief Controller Classname
*/
protected ?string $classname = NULL;
/**
* @brief Controller instance
*/
public mixed $dispatcherController = NULL;
/**
* Init
*
* @return void
* @throws DomainException
/var/www/vhosts/emtbw.com/httpdocs/develop/index.php
<?php
/**
* @brief Public bootstrap
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 18 Feb 2013
*/
use IPS\Dispatcher\Front;
define('REPORT_EXCEPTIONS', TRUE);
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
require_once 'init.php';
Front::i()->run();