Elgg  Version 5.1
Functions
gatekeepers.php File Reference

Go to the source code of this file.

Functions

 elgg_group_tool_gatekeeper (string $tool_name, int $group_guid=null)
 Checks if a group has a specific tool enabled. More...
 
 elgg_signed_request_gatekeeper ()
 Validates if the HMAC signature of the current request is valid Issues 403 response if signature is invalid. More...
 
 elgg_gatekeeper ()
 Used at the top of a page to mark it as logged in users only. More...
 
 elgg_admin_gatekeeper ()
 Used at the top of a page to mark it as admin only. More...
 
 elgg_entity_gatekeeper (int $guid, string $type=null, string $subtype=null, bool $validate_can_edit=false)
 Can the viewer see this entity? More...
 
 elgg_ajax_gatekeeper ()
 Require that the current request be an XHR. More...
 

Function Documentation

elgg_admin_gatekeeper ( )

Used at the top of a page to mark it as admin only.

Returns
void
Exceptions

Definition at line 75 of file gatekeepers.php.

elgg_ajax_gatekeeper ( )

Require that the current request be an XHR.

If not, execution of the current function will end and a 400 response page will be sent.

Returns
void
Exceptions

Definition at line 112 of file gatekeepers.php.

elgg_entity_gatekeeper ( int  $guid,
string  $type = null,
string  $subtype = null,
bool  $validate_can_edit = false 
)

Can the viewer see this entity?

Tests if the entity exists and whether the viewer has access to the entity if it does. If the viewer cannot view this entity, it forwards to an appropriate page.

Parameters
int$guidEntity GUID
string$typeOptional required entity type
string$subtypeOptional required entity subtype
bool$validate_can_editflag to check canEdit access
Returns
void
Exceptions
Exception

Definition at line 99 of file gatekeepers.php.

elgg_gatekeeper ( )

Used at the top of a page to mark it as logged in users only.

Returns
void
Exceptions

Definition at line 64 of file gatekeepers.php.

elgg_group_tool_gatekeeper ( string  $tool_name,
int  $group_guid = null 
)

Checks if a group has a specific tool enabled.

Forward to the group if the tool is disabled.

Parameters
string$tool_nameThe name of the group tool to check
int$group_guidThe group that owns the page. If not set, this will be pulled from elgg_get_page_owner_guid().
Returns
void
Exceptions
GroupToolGatekeeperException
Since
3.0.0

Definition at line 20 of file gatekeepers.php.

elgg_signed_request_gatekeeper ( )

Validates if the HMAC signature of the current request is valid Issues 403 response if signature is invalid.

Returns
void
Exceptions

Definition at line 49 of file gatekeepers.php.