class IpLoginPageCacheRequestPolicy in IP Login 4.x
A policy evaluating to static::DENY when a user needs to be logged in by IP.
Hierarchy
- class \Drupal\ip_login\IpLoginPageCacheRequestPolicy implements RequestPolicyInterface
Expanded class hierarchy of IpLoginPageCacheRequestPolicy
File
- src/
IpLoginPageCacheRequestPolicy.php, line 11
Namespace
Drupal\ip_loginView source
class IpLoginPageCacheRequestPolicy implements RequestPolicyInterface {
/**
* {@inheritdoc}
*/
public function check(Request $request) {
// Ensure that we don't deliver cached pages for users who can be logged in
// automatically.
if ($request->attributes
->get('ip_login_uid')) {
return static::DENY;
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IpLoginPageCacheRequestPolicy:: |
public | function |
Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface:: |
|
RequestPolicyInterface:: |
constant | Allow delivery of cached pages. | ||
RequestPolicyInterface:: |
constant | Deny delivery of cached pages. |