You are here

class IpLoginPageCacheRequestPolicy in IP Login 4.x

A policy evaluating to static::DENY when a user needs to be logged in by IP.

Hierarchy

Expanded class hierarchy of IpLoginPageCacheRequestPolicy

File

src/IpLoginPageCacheRequestPolicy.php, line 11

Namespace

Drupal\ip_login
View 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

Namesort descending Modifiers Type Description Overrides
IpLoginPageCacheRequestPolicy::check public function Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface::check
RequestPolicyInterface::ALLOW constant Allow delivery of cached pages.
RequestPolicyInterface::DENY constant Deny delivery of cached pages.