Tracking
in package
implements
ActionInterface
uses
ActionTrait, BackwardCompatibility
Rename here and in the exportStatic call at the end of the file.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $subaction : string
- $subactions : array<string|int, mixed>
- $obj : static
Methods
- activity() : void
- Handles tracking a user's activity
- call() : void
- Convenience method to load() and execute() an instance of this class.
- canBeLogged() : bool
- Determines whether this action can be logged in the online log.
- canShowDebuggingInfo() : bool
- Determines whether debugging info should be shown.
- canShowInMaintenanceMode() : bool
- Determines whether this action allows access in maintenance mode.
- edits() : void
- Tracks a user's profile edits.
- execute() : void
- Dispatcher to whichever sub-action method is necessary.
- getOutputType() : OutputTypeInterface
- Gets the output type for this action.
- groupRequests() : void
- Display the history of group requests made by the user whose profile we are viewing.
- ip() : void
- Handles tracking a particular IP address.
- isAgreementAction() : bool
- Determines whether this action can be accessed without accepting the registration agreement and privacy policy.
- isRestrictedGuestAccessAllowed() : bool
- Determines whether this action allows access if guest access is restricted.
- isSimpleAction() : bool
- Determines whether this is a simple action.
- list_getGroupRequests() : array<string|int, mixed>
- Loads up information about a user's group requests. Callback for the list in trackGroupReq()
- list_getGroupRequestsCount() : int
- How many edits?
- list_getLoginCount() : int
- Finds the total number of tracked logins for a particular user
- list_getLogins() : array<string|int, mixed>
- Callback for the list in trackLogins.
- list_getProfileEditCount() : int
- How many edits?
- list_getProfileEdits() : array<string|int, mixed>
- Loads up information about a user's profile edits. Callback for the list in trackEdits()
- list_getUserErrorCount() : int
- Get the number of user errors
- list_getUserErrors() : array<string|int, mixed>
- Gets all of the errors generated by a user's actions. Callback for the list in track_activity
- load() : static
- Static wrapper for constructor.
- logins() : void
- Tracks a user's logins.
- subActionProvider() : void
- Backwards compatibility function for handling profile-related subactions
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
Properties
$subaction
public
string
$subaction
= 'activity'
The requested sub-action. This should be set by the constructor.
$subactions
public
static array<string|int, mixed>
$subactions
= ['activity' => ['activity', 'trackActivity', 'moderate_forum'], 'ip' => ['ip', 'trackIP', 'moderate_forum'], 'edits' => ['edits', 'trackEdits', 'moderate_forum'], 'groupreq' => ['groupRequests', 'trackGroupRequests', 'approve_group_requests'], 'logins' => ['logins', 'trackLogins', 'moderate_forum']]
Available sub-actions.
Keys are $_REQUEST['sa'] params. Values are arrays of the form:
array('method', 'txt_key_for_page_title', 'permission')
$obj
protected
static static
$obj
An instance of this class. This is used by the load() method to prevent multiple instantiations.
Methods
activity()
Handles tracking a user's activity
public
activity() : void
call()
Convenience method to load() and execute() an instance of this class.
public
static call() : void
canBeLogged()
Determines whether this action can be logged in the online log.
public
canBeLogged() : bool
Return values
boolcanShowDebuggingInfo()
Determines whether debugging info should be shown.
public
canShowDebuggingInfo() : bool
Return values
boolcanShowInMaintenanceMode()
Determines whether this action allows access in maintenance mode.
public
canShowInMaintenanceMode() : bool
Return values
bool —True if access is allowed, false otherwise.
edits()
Tracks a user's profile edits.
public
edits() : void
execute()
Dispatcher to whichever sub-action method is necessary.
public
execute() : void
getOutputType()
Gets the output type for this action.
public
getOutputType() : OutputTypeInterface
Return values
OutputTypeInterfacegroupRequests()
Display the history of group requests made by the user whose profile we are viewing.
public
groupRequests() : void
ip()
Handles tracking a particular IP address.
public
ip() : void
isAgreementAction()
Determines whether this action can be accessed without accepting the registration agreement and privacy policy.
public
isAgreementAction() : bool
Return values
boolisRestrictedGuestAccessAllowed()
Determines whether this action allows access if guest access is restricted.
public
isRestrictedGuestAccessAllowed() : bool
Return values
bool —True if access is allowed, false otherwise.
isSimpleAction()
Determines whether this is a simple action.
public
isSimpleAction() : bool
Return values
boollist_getGroupRequests()
Loads up information about a user's group requests. Callback for the list in trackGroupReq()
public
static list_getGroupRequests(int $start, int $items_per_page, string $sort) : array<string|int, mixed>
Parameters
- $start : int
-
Which item to start with (for pagination purposes)
- $items_per_page : int
-
How many items to show on each page
- $sort : string
-
A string indicating how to sort the results
Return values
array<string|int, mixed> —An array of information about the user's group requests
list_getGroupRequestsCount()
How many edits?
public
static list_getGroupRequestsCount() : int
Return values
int —The number of profile edits
list_getLoginCount()
Finds the total number of tracked logins for a particular user
public
static list_getLoginCount(string $where[, array<string|int, mixed> $where_vars = [] ]) : int
Parameters
- $where : string
-
A query to limit which logins are counted
- $where_vars : array<string|int, mixed> = []
-
An array of parameters for $where
Return values
int —count of messages matching the IP
list_getLogins()
Callback for the list in trackLogins.
public
static list_getLogins(int $start, int $items_per_page, string $sort, string $where[, array<string|int, mixed> $where_vars = [] ]) : array<string|int, mixed>
Parameters
- $start : int
-
Which item to start with (not used here)
- $items_per_page : int
-
How many items to show on each page (not used here)
- $sort : string
-
A string indicating
- $where : string
-
A query to filter results (not used here)
- $where_vars : array<string|int, mixed> = []
-
An array of parameters for $where. Only 'current_member' (the ID of the member) is used here
Return values
array<string|int, mixed> —An array of information about user logins
list_getProfileEditCount()
How many edits?
public
static list_getProfileEditCount() : int
Return values
int —The number of profile edits
list_getProfileEdits()
Loads up information about a user's profile edits. Callback for the list in trackEdits()
public
static list_getProfileEdits(int $start, int $items_per_page, string $sort) : array<string|int, mixed>
Parameters
- $start : int
-
Which item to start with (for pagination purposes)
- $items_per_page : int
-
How many items to show on each page
- $sort : string
-
A string indicating how to sort the results
Return values
array<string|int, mixed> —An array of information about the profile edits
list_getUserErrorCount()
Get the number of user errors
public
static list_getUserErrorCount(string $where[, array<string|int, mixed> $where_vars = [] ]) : int
Parameters
- $where : string
-
A query to limit which errors are counted
- $where_vars : array<string|int, mixed> = []
-
The parameters for $where
Return values
int —Number of user errors
list_getUserErrors()
Gets all of the errors generated by a user's actions. Callback for the list in track_activity
public
static list_getUserErrors(int $start, int $items_per_page, string $sort, string $where[, array<string|int, mixed> $where_vars = [] ]) : array<string|int, mixed>
Parameters
- $start : int
-
Which item to start with (for pagination purposes)
- $items_per_page : int
-
How many items to show on each page
- $sort : string
-
A string indicating how to sort the results
- $where : string
-
A query indicating how to filter the results (eg 'id_member={int:id_member}')
- $where_vars : array<string|int, mixed> = []
-
An array of parameters for $where
Return values
array<string|int, mixed> —An array of information about the error messages
load()
Static wrapper for constructor.
public
static load() : static
Return values
static —An instance of this class.
logins()
Tracks a user's logins.
public
logins() : void
subActionProvider()
Backwards compatibility function for handling profile-related subactions
public
static subActionProvider(int $memID[, null|string $sa = null ][, bool $updateRequest = false ][, bool $loadSelfFirst = true ][, bool $loadProfile = false ][, bool $defaultSettings = false ]) : void
Parameters
- $memID : int
-
The member ID
- $sa : null|string = null
-
The subaction
- $updateRequest : bool = false
-
Whether to update $_REQUEST['u']
- $loadSelfFirst : bool = true
-
Whether to load the current user's profile first
- $loadProfile : bool = false
-
Whether to load the profile of the specified member
- $defaultSettings : bool = false
-
Not used?
__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed