Elgg  Version 3.0
UpgradeGatekeeper.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Router\Middleware;
4 
7 
12 
21  public function __invoke(\Elgg\Request $request) {
22 
24  return null;
25  }
26 
27  if (!_elgg_config()->security_protect_upgrade) {
28  return null;
29  }
30 
31  $url = $request->getURL();
32  if (!_elgg_services()->urlSigner->isValid($url)) {
33  throw new UpgradeGatekeeperException();
34  }
35  }
36 
37 }
Protect upgrade.php from unauthorized execution.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:57
$request
Page handler for autocomplete endpoint.
Definition: livesearch.php:9
__invoke(\Elgg\Request $request)
Protect upgrade.php from unauthorized execution.
Configuration exception.
$url
Definition: default.php:33
Thrown when the request to upgrade.php isn&#39;t valid.
_elgg_config()
Get the Elgg config service.
Request container.
Definition: Request.php:13
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292