Members
in package
implements
ActionInterface
uses
ActionTrait, BackwardCompatibility
Shows a list of members or a selection of members.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $activation_numbers : array<string|int, mixed>
- $awaiting_activation : int
- $awaiting_approval : int
- $current_filter : int
- $membergroups : array<string|int, mixed>
- $postgroups : array<string|int, mixed>
- $show_activate : bool
- $show_approve : bool
- $subaction : string
- $subactions : array<string|int, mixed>
- $obj : static
Methods
- approve() : void
- This method handles the approval, rejection, activation or deletion of members.
- browse() : void
- Lists all members who are awaiting approval/activation, sortable on different columns.
- 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.
- execute() : void
- Dispatcher to whichever sub-action method is necessary.
- getConfigVars() : array<string|int, mixed>
- Gets the configuration variables for this admin area.
- getOutputType() : OutputTypeInterface
- Gets the output type for this action.
- 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_getMembers() : array<string|int, mixed>
- Callback for SMF\ItemList().
- list_getNumMembers() : int
- Callback for SMF\ItemList().
- load() : static
- Static wrapper for constructor.
- search() : void
- Search the member list, using one or more criteria.
- settings() : void
- Handles settings dealing with membership.
- subActionProvider() : null|array<string|int, mixed>
- Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
- view() : void
- View all members list. It allows sorting on several columns, and deletion of selected members. It also handles the search query sent by ?action=admin;area=viewmembers;sa=search.
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
- getActivationCounts() : void
- Fetches all the activation counts for ViewMembers.
- populateDuplicateMembers() : void
- Find potential duplicate registration members based on the same IP address
Properties
$activation_numbers
public
array<string|int, mixed>
$activation_numbers
= []
$awaiting_activation
public
int
$awaiting_activation
= 0
$awaiting_approval
public
int
$awaiting_approval
= 0
$current_filter
public
int
$current_filter
= -1
$membergroups
public
array<string|int, mixed>
$membergroups
= []
$postgroups
public
array<string|int, mixed>
$postgroups
= []
$show_activate
public
bool
$show_activate
= false
$show_approve
public
bool
$show_approve
= false
$subaction
public
string
$subaction
= 'all'
The requested sub-action. This should be set by the constructor.
$subactions
public
static array<string|int, mixed>
$subactions
= ['all' => ['view', 'moderate_forum'], 'approve' => ['approve', 'moderate_forum'], 'browse' => ['browse', 'moderate_forum'], 'search' => ['search', 'moderate_forum'], 'query' => ['view', 'moderate_forum'], 'settings' => ['settings', 'admin_forum']]
Available sub-actions.
Format: 'sa' => array('method', 'required_permission')
$obj
protected
static static
$obj
An instance of this class. This is used by the load() method to prevent multiple instantiations.
Methods
approve()
This method handles the approval, rejection, activation or deletion of members.
public
approve() : void
Called by ?action=admin;area=viewmembers;sa=approve. Requires the moderate_forum permission. Redirects to ?action=admin;area=viewmembers;sa=browse with the same parameters as the calling page.
browse()
Lists all members who are awaiting approval/activation, sortable on different columns.
public
browse() : void
It allows instant approval or activation of (a selection of) members. Called by ?action=admin;area=viewmembers;sa=browse;type=approve or ?action=admin;area=viewmembers;sa=browse;type=activate. The form submits to ?action=admin;area=viewmembers;sa=approve. Requires the moderate_forum permission.
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.
execute()
Dispatcher to whichever sub-action method is necessary.
public
execute() : void
getConfigVars()
Gets the configuration variables for this admin area.
public
static getConfigVars() : array<string|int, mixed>
Return values
array<string|int, mixed> —$config_vars for the member settings area.
getOutputType()
Gets the output type for this action.
public
getOutputType() : OutputTypeInterface
Return values
OutputTypeInterfaceisAgreementAction()
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_getMembers()
Callback for SMF\ItemList().
public
static list_getMembers(int $start, int $items_per_page, string $sort, string $where[, array<string|int, mixed> $where_params = [] ][, bool $get_duplicates = false ]) : array<string|int, mixed>
Parameters
- $start : int
-
Which item to start with (for pagination purposes)
- $items_per_page : int
-
How many items to show per page
- $sort : string
-
An SQL query indicating how to sort the results
- $where : string
-
An SQL query used to filter the results
- $where_params : array<string|int, mixed> = []
-
An array of parameters for $where
- $get_duplicates : bool = false
-
Whether to get duplicates (used for the admin member list)
Return values
array<string|int, mixed> —An array of information for displaying the list of members
list_getNumMembers()
Callback for SMF\ItemList().
public
static list_getNumMembers(string $where[, array<string|int, mixed> $where_params = [] ]) : int
Parameters
- $where : string
-
An SQL query to filter the results
- $where_params : array<string|int, mixed> = []
-
An array of parameters for $where
Return values
int —The number of members matching the given situation
load()
Static wrapper for constructor.
public
static load() : static
Return values
static —An instance of this class.
search()
Search the member list, using one or more criteria.
public
search() : void
Called by ?action=admin;area=viewmembers;sa=search. Requires the moderate_forum permission. The form is submitted to action=admin;area=viewmembers;sa=query.
settings()
Handles settings dealing with membership.
public
settings() : void
Accessed by ?action=admin;area=viewmembers;sa=settings. Requires the admin_forum permission.
subActionProvider()
Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
public
static subActionProvider([null|string $sa = null ][, bool $return_config = false ][, string|null $activity = null ]) : null|array<string|int, mixed>
Parameters
- $sa : null|string = null
- $return_config : bool = false
- $activity : string|null = null
Return values
null|array<string|int, mixed>view()
View all members list. It allows sorting on several columns, and deletion of selected members. It also handles the search query sent by ?action=admin;area=viewmembers;sa=search.
public
view() : void
Called by ?action=admin;area=viewmembers;sa=all or ?action=admin;area=viewmembers;sa=query. Requires the moderate_forum permission.
__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed
getActivationCounts()
Fetches all the activation counts for ViewMembers.
protected
getActivationCounts() : void
populateDuplicateMembers()
Find potential duplicate registration members based on the same IP address
protected
static populateDuplicateMembers(array<string|int, mixed> &$members) : void
Parameters
- $members : array<string|int, mixed>
-
An array of members