20 if ($request->
elgg()->session_manager->isAdminLoggedIn()) {
24 if (!$request->
elgg()->config->elgg_maintenance_mode) {
29 if (self::allowCurrentUrl($request)) {
33 if (str_starts_with($request->
getRoute(),
'action:')) {
57 if ($route !==
'action:login') {
77 $current_url = $request->
getURL();
79 $current_path = preg_replace(
'/^https?/',
'', $current_url);
83 $current_path =
false;
89 'current_path' => $current_path,
90 'current_url' => $current_url,
getURL()
Get URL of the request.
$params
Saves global plugin settings.
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_get_user_by_username(string $username, bool $try_email=false)
Get a user by username.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
elgg_trigger_event_results(string $event, string $type, array $params=[], $returnvalue=null)
Triggers an event where it is expected that the mixed return value could be manipulated by event call...
getParam($key, $default=null, $filter=true)
Get an element of the params array.
elgg_view_resource(string $name, array $vars=[])
Render a resource view.
elgg_strlen()
Wrapper function for mb_strlen().
elgg_error_response(string|array $message= '', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
const ELGG_HTTP_SERVICE_UNAVAILABLE
elgg_strpos()
Wrapper function for mb_strpos().
elgg()
Get the DI container.
elgg_get_site_url()
Get the URL for the current (or specified) site, ending with "/".
Protects a route if site is in maintenance mode.
static allowCurrentUrl(Request $request)
When in maintenance mode, should the current URL be handled normally?
elgg_substr()
Wrapper function for mb_substr().
__invoke(Request $request)
Gatekeeper.
isAllowedAction(Request $request)
Checks if current action is allowed.
getRoute()
Get the name of the route.
_elgg_services()
Get the global service provider.