class vB5_Frontend_Application extends vB5_ApplicationAbstract

Constants

ON_FIRE_MESSAGE

Properties

static protected $instance from vB5_ApplicationAbstract
protected $router from vB5_ApplicationAbstract
static protected $needCharset from vB5_ApplicationAbstract

Methods

static 
instance()

No description

static 
init($configFile)

No description

static 
setHeaders()

Replacing meta tag from the header.xml with header in the requests. See VBV-6361

getRouter()

No description

string
getRequestCharset()

Attempt to determine what charset the browser is posting

static 
isAjax()

Is this an AJAX request.

convertInputArrayCharset()

Convert the PHP input superglobals to the vBulletin charset if it is different from what the request charset is. This is most likely on an AJAX request.

static 
handleException(mixed $exception, bool $simple = false)

Displays a vB page for exceptions

static 
handleNoPermission()

Displays a vB page for no_permission exception

static 
handleBannedUsers(mixed $bannedInfo)

Displays a vB page for banned users

static 
handlePermanentRedirect($url)

No description

static 
minErrorPage($error, $exception = null, $trace = null)

No description

static 
setCharset()

No description

static 
showErrorPage($error, $simple = false)

No description

static 
handleFormError($error, $url)

No description

static 
showErrorForm($error, $url)

No description

static 
checkState($route = array())

No description

static 
showMsgPage(string $title = '', string $msg = '', string $state = '')

Show a simple and clear message page which contains no widget

static 
showMsgPageBare(string $title = '', string $msg = '', string $state = '')

Same as showMsgPage(), but uses the message_page_bare template which uses the minimalistic bare_header & bare_footer templates.

static 
showNoPermissionPage($message = '')

No description

static 
showBannedPage($bannedInfo)

No description

static 
getPreheader()

No description

static 
getRouteInfo()

No description

static 
getIgnoreNPNotices()

No description

static 
checkCSRF()

No description

sendAsJson(mixed $data)

Sends the response as a JSON encoded string

outputToBrowserAndCloseConnection(String $output)

Attempts to close the connection to the browser without terminating the PHP script. This is heavily environment specific and somewhat fragile.

sendAsJsonAndCloseConnection(mixed $responseToSendAsJson = array())

Sends the response as a JSON encoded string Attempts to close the connection to the browser without terminating the PHP script. This is heavily environment specific and somewhat fragile.

allowRedirectToUrl($url)

No description

Details

static instance()

at line 15
static init($configFile)

Parameters

$configFile

static protected setHeaders()

Replacing meta tag from the header.xml with header in the requests. See VBV-6361

getRouter()

protected string getRequestCharset()

Attempt to determine what charset the browser is posting

The HTTP/HTML standards make this difficult so we look at a number of different things to try to figure it out.

Return Value

string the charset string for the request or the empty string if it could not be determined.

static protected isAjax()

Is this an AJAX request.

Note that this can be easily spoofed. Do not rely on for anything with security implications.

protected convertInputArrayCharset()

Convert the PHP input superglobals to the vBulletin charset if it is different from what the request charset is. This is most likely on an AJAX request.

static handleException(mixed $exception, bool $simple = false)

Displays a vB page for exceptions

Parameters

mixed $exception exception
bool $simple Bypass API and display simple error message

static handleNoPermission()

Displays a vB page for no_permission exception

static handleBannedUsers(mixed $bannedInfo)

Displays a vB page for banned users

Parameters

mixed $bannedInfo exception

static handlePermanentRedirect($url)

Parameters

$url

static protected minErrorPage($error, $exception = null, $trace = null)

Parameters

$error
$exception
$trace

static protected setCharset()

static protected showErrorPage($error, $simple = false)

Parameters

$error
$simple

static handleFormError($error, $url)

Parameters

$error
$url

static protected showErrorForm($error, $url)

Parameters

$error
$url

static checkState($route = array())

Parameters

$route

static showMsgPage(string $title = '', string $msg = '', string $state = '')

Show a simple and clear message page which contains no widget

Parameters

string $title Page title. HTML will be escaped.
string $msg Message to display. HTML is allowed and the caller must make sure it's valid.
string $state The state of the site

static showMsgPageBare(string $title = '', string $msg = '', string $state = '')

Same as showMsgPage(), but uses the message_page_bare template which uses the minimalistic bare_header & bare_footer templates.

Parameters

string $title Page title. HTML will be escaped.
string $msg Message to display. HTML is allowed and the caller must make sure it's valid.
string $state The state of the site

static protected showNoPermissionPage($message = '')

Parameters

$message

static protected showBannedPage($bannedInfo)

Parameters

$bannedInfo

static getPreheader()

static protected getRouteInfo()

static getIgnoreNPNotices()

final static checkCSRF()

sendAsJson(mixed $data)

Sends the response as a JSON encoded string

Parameters

mixed $data The data (usually an array) to send

outputToBrowserAndCloseConnection(String $output)

Attempts to close the connection to the browser without terminating the PHP script. This is heavily environment specific and somewhat fragile.

Currently only used by sendAsJsonAndCloseConnection().

Parameters

String $output Content to echo back to the browser along with the headers to signal connection termination.

sendAsJsonAndCloseConnection(mixed $responseToSendAsJson = array())

Sends the response as a JSON encoded string Attempts to close the connection to the browser without terminating the PHP script. This is heavily environment specific and somewhat fragile.

Parameters

mixed $responseToSendAsJson The data (usually an array) to send -- if data is an array function will add an "note" field indicating that the data was returned prior to processing (which can obscure errors) Parameter defaults to an empty array if there is no real data to send (which is common when terminating before substantial processing)

allowRedirectToUrl($url)

Parameters

$url