Spam Cleaner.

  • Deletes any posts by the spam-posting user
  • Deletes or moves any threads started by the user
  • Bans the user

package XenForo_Mvc

 Methods

Constructor

__construct(\Zend_Controller_Request_Http $request, \Zend_Controller_Response_Http $response, \XenForo_RouteMatch $routeMatch) 
Inherited

inherited_from \XenForo_Controller::__construct()
inherited_from \XenForo_ControllerPublic_Abstract::__construct()

Parameters

$request

Zend_Controller_Request_Http

$response

Zend_Controller_Response_Http

$routeMatch

XenForo_RouteMatch

actionIndex()

actionIndex() 

Asserts that the visitor is not flooding with the specified action.

assertNotFlooding(string $action, integer | null $floodingLimit) 
Inherited

Throws a response exception if flooding occurs.

inherited_from \XenForo_ControllerPublic_Abstract::assertNotFlooding()

Parameters

$action

string

$floodingLimit

integernull

Can this controller update the session activity? Returns false by default for AJAX requests.

canUpdateSessionActivity(string $controllerName, string $action, string $newState) : boolean
Inherited

Override this in specific controllers if you want action-specific behaviour.

inherited_from \XenForo_Controller::canUpdateSessionActivity()
inherited_from \XenForo_ControllerPublic_Abstract::canUpdateSessionActivity()

Parameters

$controllerName

string

$action

string

$newState

string

Returns

boolean

Ensures that the page that has been requested is valid based on the total number of results.

canonicalizePageNumber(integer $page, integer $perPage, integer $total, string $linkType, mixed $linkData) 
Inherited

If it's not valid, the page is redirected to the last valid page (via a response exception).

inherited_from \XenForo_Controller::canonicalizePageNumber()
inherited_from \XenForo_ControllerPublic_Abstract::canonicalizePageNumber()

Parameters

$page

integer

$perPage

integer

$total

integer

$linkType

string

$linkData

mixed

Canonicalizes the request URL based on the given link URL.

canonicalizeRequestUrl(string $linkUrl) 
Inherited

Canonicalization will only happen when requesting an HTML page, as it is primarily an SEO benefit.

A response exception will be thrown is redirection is required.

inherited_from \XenForo_Controller::canonicalizeRequestUrl()
inherited_from \XenForo_ControllerPublic_Abstract::canonicalizeRequestUrl()

Parameters

$linkUrl

string

Gets a dynamic redirect target based on a redirect param or the referrer.

getDynamicRedirect(string | false $fallbackUrl, boolean $useReferrer) : string
Inherited

inherited_from \XenForo_Controller::getDynamicRedirect()
inherited_from \XenForo_ControllerPublic_Abstract::getDynamicRedirect()

Parameters

$fallbackUrl

stringfalse

Fallback if no redirect or referrer is available; if false, uses index

$useReferrer

boolean

True uses the referrer if no redirect param is available

Returns

string

Gets a specific error or a general no permission response exception.

getErrorOrNoPermissionResponseException(string | \XenForo_Phrase | mixed $errorPhraseKey, boolean $stringToPhrase) : \XenForo_ControllerResponse_Exception
Inherited

If the first param is a string and $stringToPhrase is true, it will be treated as a phrase key and turned into a phrase.

If a specific phrase is requested, a general error will be thrown. Otherwise, a generic no permission error will be shown.

inherited_from \XenForo_Controller::getErrorOrNoPermissionResponseException()
inherited_from \XenForo_ControllerPublic_Abstract::getErrorOrNoPermissionResponseException()

Parameters

$errorPhraseKey

string\XenForo_Phrasemixed

A phrase key, a phrase object, or hard coded text. Or, may be empty.

$stringToPhrase

boolean

If true and the $errorPhraseKey is a string, $errorPhraseKey is treated as the name of a phrase.

Returns

Creates the specified helper class.

getHelper(string $class) : \XenForo_ControllerHelper_Abstract
Inherited

If no underscore is present in the class name, "XenForo_ControllerHelper_" is prefixed. Otherwise, a full class name is assumed.

inherited_from \XenForo_Controller::getHelper()
inherited_from \XenForo_ControllerPublic_Abstract::getHelper()

Parameters

$class

string

Full class name, or partial suffix (if no underscore)

Returns

Gets the input object.

getInput() : \XenForo_Input
Inherited

inherited_from \XenForo_Controller::getInput()
inherited_from \XenForo_ControllerPublic_Abstract::getInput()

Returns

Gets the specified model object from the cache.

getModelFromCache(string $class) : \XenForo_Model
Inherited

If it does not exist, it will be instantiated.

inherited_from \XenForo_Controller::getModelFromCache()
inherited_from \XenForo_ControllerPublic_Abstract::getModelFromCache()

Parameters

$class

string

Name of the class to load

Returns

Gets a general no permission error wrapped in an exception response.

getNoPermissionResponseException() : \XenForo_ControllerResponse_Exception
Inherited

inherited_from \XenForo_Controller::getNoPermissionResponseException()
inherited_from \XenForo_ControllerPublic_Abstract::getNoPermissionResponseException()

Returns

Gets a valid record or throws an exception.

getRecordOrError(mixed $id, \XenForo_Model $model, string $method, string $errorPhraseKey) : array
Inherited

inherited_from \XenForo_Controller::getRecordOrError()
inherited_from \XenForo_ControllerPublic_Abstract::getRecordOrError()

Parameters

$id

mixed

ID of the record to get

$model

\XenForo_Model

Model object to request from

$method

string

Method to call in the model object

$errorPhraseKey

string

Key of error phrase to use when not found

Returns

array

Gets the request object.

getRequest() : \Zend_Controller_Request_Http
Inherited

inherited_from \XenForo_Controller::getRequest()
inherited_from \XenForo_ControllerPublic_Abstract::getRequest()

Returns

\Zend_Controller_Request_Http

Gets the type of response that has been requested.

getResponseType() : string
Inherited

inherited_from \XenForo_Controller::getResponseType()
inherited_from \XenForo_ControllerPublic_Abstract::getResponseType()

Returns

string

Gets the route match for this request.

getRouteMatch() : \XenForo_RouteMatch
Inherited

This can be modified to change the response type, and the major/minor sections that will be used to setup navigation.

inherited_from \XenForo_Controller::getRouteMatch()
inherited_from \XenForo_ControllerPublic_Abstract::getRouteMatch()

Returns

Session activity details.

getSessionActivityDetailsForList(array $activities) : mixed

This must check the visiting user's permissions before returning item info. Return value may be: * false - means page is unknown * string/XenForo_Phrase - gives description for all, but no item details * array (keyed by activity keys) of strings/XenForo_Phrase objects - individual description, no item details * array (keyed by activity keys) of arrays. Sub-arrays keys: 0 = description, 1 = specific item title, 2 = specific item url.

see \global\XenForo_Controller::getSessionActivityDetailsForList()

Parameters

$activities

array

List of activity records

Returns

mixedSee above.

Gets all the view state changes.

getViewStateChanges() : array
Inherited

inherited_from \XenForo_Controller::getViewStateChanges()
inherited_from \XenForo_ControllerPublic_Abstract::getViewStateChanges()

Returns

arrayKey-value pairs

Checks for a match of one or more IPs against a list of IP and IP fragments

ipMatch(string | array $checkIps, array $ipList) : boolean
Inherited

inherited_from \XenForo_Controller::ipMatch()
inherited_from \XenForo_ControllerPublic_Abstract::ipMatch()

Parameters

$checkIps

stringarray

IP address(es)

$ipList

array

List of IP addresses

Returns

boolean

Returns true if the request method is POST and an _xfConfirm parameter exists and is true

isConfirmedPost() : boolean
Inherited

inherited_from \XenForo_Controller::isConfirmedPost()
inherited_from \XenForo_ControllerPublic_Abstract::isConfirmedPost()

Returns

boolean

This function is called immediately after an action is dispatched.

postDispatch(mixed $controllerResponse, string $controllerName, string $action) 
Inherited

inherited_from \XenForo_Controller::postDispatch()
inherited_from \XenForo_ControllerPublic_Abstract::postDispatch()

Parameters

$controllerResponse

mixed

The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.

$controllerName

string

The name of the final controller that was invoked

$action

string

The name of the final action that was invoked

This function is called immediately before an action is dispatched.

preDispatch(string $action) 
Inherited

inherited_from \XenForo_Controller::preDispatch()
inherited_from \XenForo_ControllerPublic_Abstract::preDispatch()

Parameters

$action

string

Action that is requested

Gets the response for a generic CAPTCHA failed error.

responseCaptchaFailed() : \XenForo_ControllerResponse_Error
Inherited

inherited_from \XenForo_Controller::responseCaptchaFailed()
inherited_from \XenForo_ControllerPublic_Abstract::responseCaptchaFailed()

Returns

Controller response for when you want to throw an error and display it to the user.

responseError(string | array $error, integer $responseCode, array $containerParams) : \XenForo_ControllerResponse_Error
Inherited

inherited_from \XenForo_Controller::responseError()
inherited_from \XenForo_ControllerPublic_Abstract::responseError()

Parameters

$error

stringarray

Error text to be use

$responseCode

integer

An optional HTTP response code to output

$containerParams

array

Key-value pairs of parameters to pass to the container view

Returns

Gets the exception object for controller response-style behavior.

responseException(\XenForo_ControllerResponse_Abstract $controllerResponse, integer $responseCode) : \XenForo_ControllerResponse_Exception
Inherited

This object cannot be returned from the controller; an exception must be thrown with it.

This allows any type of controller response to be invoked via an exception.

inherited_from \XenForo_Controller::responseException()
inherited_from \XenForo_ControllerPublic_Abstract::responseException()

Parameters

$controllerResponse

\XenForo_ControllerResponse_Abstract

Type of response to invoke

$responseCode

integer

HTTP response code

Returns

Gets the response for a generic flooding page.

responseFlooding(integer $floodSeconds) : \XenForo_ControllerResponse_Error
Inherited

inherited_from \XenForo_Controller::responseFlooding()
inherited_from \XenForo_ControllerPublic_Abstract::responseFlooding()

Parameters

$floodSeconds

integer

Numbers of seconds the user must wait to perform the action

Returns

Controller response for when you want to display a message to a user.

responseMessage(string $message, array $containerParams) : \XenForo_ControllerResponse_Message
Inherited

inherited_from \XenForo_Controller::responseMessage()
inherited_from \XenForo_ControllerPublic_Abstract::responseMessage()

Parameters

$message

string

Error text to be use

$containerParams

array

Key-value pairs of parameters to pass to the container view

Returns

Gets the response for a generic no permission page.

responseNoPermission() : \XenForo_ControllerResponse_Error
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::responseNoPermission()

Returns

Controller response for when you want to redirect to a different URL.

responseRedirect(integer $redirectType, string $redirectTarget, mixed $redirectMessage, array $redirectParams) : \XenForo_ControllerResponse_Redirect
Inherited

This will happen in a separate request.

inherited_from \XenForo_Controller::responseRedirect()
inherited_from \XenForo_ControllerPublic_Abstract::responseRedirect()

Parameters

$redirectType

integer

See {@link XenForo_ControllerResponse_Redirect}

$redirectTarget

string

Target to redirect to

$redirectMessage

mixed

Message with which to redirect

$redirectParams

array

Extra parameters for the redirect

Returns

Controller response for when you want to reroute to a different controller/action.

responseReroute(string $controllerName, string $action, array $containerParams) : \XenForo_ControllerResponse_Reroute
Inherited

inherited_from \XenForo_Controller::responseReroute()
inherited_from \XenForo_ControllerPublic_Abstract::responseReroute()

Parameters

$controllerName

string

Name of the controller to reroute to

$action

string

Name of the action to reroute to

$containerParams

array

Key-value pairs of parameters to pass to the container view

Returns

Controller response for when you want to output using a view class.

responseView(string $viewName, string $templateName, array $params, array $containerParams) : \XenForo_ControllerResponse_View
Inherited

inherited_from \XenForo_Controller::responseView()
inherited_from \XenForo_ControllerPublic_Abstract::responseView()

Parameters

$viewName

string

Name of the view class to be rendered

$templateName

string

Name of the template that should be displayed (may be ignored by view)

$params

array

Key-value pairs of parameters to pass to the view

$containerParams

array

Key-value pairs of parameters to pass to the container view

Returns

Sets a change to the view state.

setViewStateChange(string $state, mixed $data) 
Inherited

inherited_from \XenForo_Controller::setViewStateChange()
inherited_from \XenForo_ControllerPublic_Abstract::setViewStateChange()

Parameters

$state

string

Name of state to change

$data

mixed

Updates the session records.

updateSession(mixed $controllerResponse, string $controllerName, string $action) 
Inherited

This should run on all pages, provided they not rerouting to another controller. Session saving should handle double calls, if they happen.

inherited_from \XenForo_Controller::updateSession()
inherited_from \XenForo_ControllerPublic_Abstract::updateSession()

Parameters

$controllerResponse

mixed

The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.

$controllerName

string

$action

string

Update a user's session activity.

updateSessionActivity(mixed $controllerResponse, string $controllerName, string $action) 
Inherited

inherited_from \XenForo_Controller::updateSessionActivity()
inherited_from \XenForo_ControllerPublic_Abstract::updateSessionActivity()

Parameters

$controllerResponse

mixed

The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.

$controllerName

string

$action

string

Checks that the board is currently active (and can be viewed by the visitor) or throws an exception.

_assertBoardActive(string $action) 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_assertBoardActive()

Parameters

$action

string

Asserts that the installed version of the board matches the files.

_assertCorrectVersion(string $action) 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_assertCorrectVersion()

Parameters

$action

string

Asserts that the user's IP address is not banned.

_assertIpNotBanned() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_assertIpNotBanned()

Assert that the visitor is not banned.

_assertNotBanned() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_assertNotBanned()

Helper to assert that this action is available over POST only.

_assertPostOnly() 
Inherited

Throws an exception if the request is not via POST.

inherited_from \XenForo_Controller::_assertPostOnly()
inherited_from \XenForo_ControllerPublic_Abstract::_assertPostOnly()

Helper to assert that access to this action requires registration and logged-in-edness.

_assertRegistrationRequired() 
Inherited

Throws an exception for visitors that do not meet these criteria.

inherited_from \XenForo_ControllerPublic_Abstract::_assertRegistrationRequired()

Assert that the visitor has the necessary viewing permissions.

_assertViewingPermissions(string $action) 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_assertViewingPermissions()

Parameters

$action

string

Checks a request for CSRF issues.

_checkCsrf(string $action) 
Inherited

This is only checked for POST requests (with session info) that aren't Ajax requests (relies on browser-level cross-domain policies).

The token is retrieved from the "_xfToken" request param.

inherited_from \XenForo_Controller::_checkCsrf()
inherited_from \XenForo_ControllerPublic_Abstract::_checkCsrf()

Parameters

$action

string

Gets for a CSRF issue using a standard formatted token.

_checkCsrfFromToken(string $token, boolean $throw) : boolean
Inherited

Throws an exception if a CSRF issue is detected.

inherited_from \XenForo_Controller::_checkCsrfFromToken()
inherited_from \XenForo_ControllerPublic_Abstract::_checkCsrfFromToken()

Parameters

$token

string

Format: ,,

$throw

boolean

If true, an exception is thrown when failing; otherwise, a return is used

Returns

booleanTrue if passed, false otherwise; only applies when $throw is false

Instructs a DataWriter to delete data based on a POST input parameter.

_deleteData(string $dataWriterName, string | array $existingDataKeyName, string $redirectLink, string $redirectMessage) 
Inherited

inherited_from \XenForo_Controller::_deleteData()
inherited_from \XenForo_ControllerPublic_Abstract::_deleteData()

Parameters

$dataWriterName

string

Name of DataWriter class that will perform the deletion

$existingDataKeyName

stringarray

Name of input parameter that contains the existing data key OR array containing the keys for a multi-key parameter

$redirectLink

string

URL to which to redirect on success

$redirectMessage

string

Redirection message to show on successful deletion

Discourage the current visitor from remaining on the board by making theirs a bad experience.

_discourage(string $action) 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_discourage()

Parameters

$action

string

Returns an array of IPs for the current client

_getClientIps() : 
Inherited

inherited_from \XenForo_Controller::_getClientIps()
inherited_from \XenForo_ControllerPublic_Abstract::_getClientIps()

Returns

Fetches name/value/existingDataKey from input.

_getFieldValidationInputParams() : array
Inherited

Primarily used for AJAX autovalidation actions of single fields.

inherited_from \XenForo_Controller::_getFieldValidationInputParams()
inherited_from \XenForo_ControllerPublic_Abstract::_getFieldValidationInputParams()

Returns

array[name, value, existingDataKey]

Gets the user names that are ignored in a particular batch of content.

_getIgnoredContentUserNames(array $records) : array
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_getIgnoredContentUserNames()

Parameters

$records

array

Array of content (or may be a single record)

Returns

array[user id] => user name

Turns a serialized (by jQuery) query string from input into a XenForo_Input object.

_getInputFromSerialized(string $varname, boolean $throw, $errorPhraseKey) : \XenForo_Input | false
Inherited

inherited_from \XenForo_Controller::_getInputFromSerialized()
inherited_from \XenForo_ControllerPublic_Abstract::_getInputFromSerialized()

Parameters

$varname

string

Name of index to fetch from $this->_input

$throw

boolean

On error, throw an exception or return false

$errorPhraseKey

string

Returns

Gets an array containing the isRegistrationOrLogin parameter

_getRegistrationContainerParams() : array
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_getRegistrationContainerParams()

Returns

array

_getSpamCleanerModel()

_getSpamCleanerModel() : \XenForo_Model_SpamCleaner

_getUserModel()

_getUserModel() : \XenForo_Model_User

Performs particular actions if the request method is POST

_handlePost(string $action) 
Inherited

inherited_from \XenForo_Controller::_handlePost()
inherited_from \XenForo_ControllerPublic_Abstract::_handlePost()

Parameters

$action

string

Checks whether a user is being discouraged, either by user preference or IP match

_isDiscouraged() : boolean
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_isDiscouraged()

Returns

boolean

Checks for the presence of the _xfNoRedirect parameter that is sent by AutoValidator forms when they submit via AJAX

_noRedirect() : boolean
Inherited

inherited_from \XenForo_Controller::_noRedirect()
inherited_from \XenForo_ControllerPublic_Abstract::_noRedirect()

Returns

boolean

Method designed to be overridden by child classes to add post-dispatch behaviors

_postDispatch(mixed $controllerResponse, string $controllerName, string $action) 
Inherited

inherited_from \XenForo_Controller::_postDispatch()
inherited_from \XenForo_ControllerPublic_Abstract::_postDispatch()

Parameters

$controllerResponse

mixed

The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.

$controllerName

string

The name of the final controller that was invoked

$action

string

The name of the final action that was invoked

Method designed to be overridden by child classes to add post-dispatch behaviors.

_postDispatchType(mixed $controllerResponse, string $controllerName, string $action) 
Inherited

This differs from _postDispatch() in that it is designed for abstract controller type classes to override. Specific controllers should override _postDispatch instead.

inherited_from \XenForo_Controller::_postDispatchType()
inherited_from \XenForo_ControllerPublic_Abstract::_postDispatchType()

Parameters

$controllerResponse

mixed

The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.

$controllerName

string

The name of the final controller that was invoked

$action

string

The name of the final action that was invoked

Method designed to be overridden by child classes to add pre-dispatch behaviors.

_preDispatch(string $action) 

This method should only be overridden by specific, concrete controllers.

Parameters

$action

string

Action that is requested

Method designed to be overridden by child classes to add pre-dispatch behaviors before any other pre-dispatch checks are called.

_preDispatchFirst(string $action) 
Inherited

inherited_from \XenForo_Controller::_preDispatchFirst()
inherited_from \XenForo_ControllerPublic_Abstract::_preDispatchFirst()

Parameters

$action

string

Pre-dispatch behaviors for the whole set of public controllers.

_preDispatchType(string $action) 
Inherited

This differs from _preDispatch() in that it is designed for abstract controller type classes to override. Specific controllers should override _preDispatch instead.

inherited_from \XenForo_ControllerPublic_Abstract::_preDispatchType()

Parameters

$action

string

Action that is requested

Setup the session.

_setupSession(string $action) 
Inherited

inherited_from \XenForo_Controller::_setupSession()
inherited_from \XenForo_ControllerPublic_Abstract::_setupSession()

Parameters

$action

string

Updates the admin session caches if necessary.

_updateAdminSessionCaches() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_updateAdminSessionCaches()

Updates the counts in the session for the user queue.

_updateAdminSessionModerationCounts() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_updateAdminSessionModerationCounts()

Fetch the list of dismissed notices into the session if it's not already there

_updateDismissedNoticeSessionCache() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_updateDismissedNoticeSessionCache()

Updates the moderator session caches if necessary.

_updateModeratorSessionCaches() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_updateModeratorSessionCaches()

Updates the counts in the session for the moderation queue.

_updateModeratorSessionModerationCounts() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_updateModeratorSessionModerationCounts()

Updates the counts in the session for reported content.

_updateModeratorSessionReportCounts() 
Inherited

inherited_from \XenForo_ControllerPublic_Abstract::_updateModeratorSessionReportCounts()

Validates a field against a DataWriter.

_validateField(string $dataWriterName, array $data, array $options, array $extraData) : \XenForo_ControllerResponse_Redirect | \XenForo_ControllerResponse_Error
Inherited

Expects 'name' and 'value' keys to be present in the request.

inherited_from \XenForo_Controller::_validateField()
inherited_from \XenForo_ControllerPublic_Abstract::_validateField()

Parameters

$dataWriterName

string

Name of DataWriter against which this field will be validated

$data

array

Array containing name, value or existingDataKey, which will override those fetched from _getFieldValidationInputParams

$options

array

Key-value pairs of options to set

$extraData

array

Key-value pairs of extra data to set

Returns

 Properties

 

Container for various items that have been "executed" in one controller and shouldn't be executed again in this request.

$_executed : array
Inherited

inherited_from \XenForo_Controller::$$_executed
inherited_from \XenForo_ControllerPublic_Abstract::$$_executed
 

Input object.

$_input : \XenForo_Input
Inherited

inherited_from \XenForo_Controller::$$_input
inherited_from \XenForo_ControllerPublic_Abstract::$$_input
 

Standard approach to caching model objects for the lifetime of the controller.

$_modelCache : array
Inherited

inherited_from \XenForo_Controller::$$_modelCache
inherited_from \XenForo_ControllerPublic_Abstract::$$_modelCache
 

Request object.

$_request : \Zend_Controller_Request_Http
Inherited

inherited_from \XenForo_Controller::$$_request
inherited_from \XenForo_ControllerPublic_Abstract::$$_request
 

Response object.

$_response : \Zend_Controller_Response_Http
Inherited

inherited_from \XenForo_Controller::$$_response
inherited_from \XenForo_ControllerPublic_Abstract::$$_response
 

The route match object for this request.

$_routeMatch : \XenForo_RouteMatch
Inherited

inherited_from \XenForo_Controller::$$_routeMatch
inherited_from \XenForo_ControllerPublic_Abstract::$$_routeMatch
 

List of explicit changes to the view state.

$_viewStateChanges : array
Inherited

View state changes are specific to the dependency manager, but may include things like changing the styleId.

inherited_from \XenForo_Controller::$$_viewStateChanges
inherited_from \XenForo_ControllerPublic_Abstract::$$_viewStateChanges