public function SpiController::sendAccess in Acquia Connector 8
Same name and namespace in other branches
- 8.2 src/Controller/SpiController.php \Drupal\acquia_connector\Controller\SpiController::sendAccess()
- 3.x src/Controller/SpiController.php \Drupal\acquia_connector\Controller\SpiController::sendAccess()
Access callback check for SPI send independent call.
1 string reference to 'SpiController::sendAccess'
File
- src/
Controller/ SpiController.php, line 1250
Class
- SpiController
- SPI Controller class.
Namespace
Drupal\acquia_connector\ControllerCode
public function sendAccess() {
$request = \Drupal::request();
$storage = new Storage();
$acquia_key = $storage
->getKey();
if (!empty($acquia_key) && $request
->get('key')) {
$key = sha1(\Drupal::service('private_key')
->get());
if ($key === $request
->get('key')) {
return AccessResultAllowed::allowed();
}
}
return AccessResultForbidden::forbidden();
}