You are here

function protected_node_boost_is_cacheable in Protected Node 6

Same name and namespace in other branches
  1. 7 protected_node.module \protected_node_boost_is_cacheable()
  2. 1.0.x protected_node.module \protected_node_boost_is_cacheable()

Prevent boost from caching protected nodes.

@todo We also need to make sure the cache gets cleared whenever the protection is turned on.

File

./protected_node.module, line 827

Code

function protected_node_boost_is_cacheable($path) {

  // the $path may be an alias, unalias first
  $url = drupal_lookup_path('source', $path);
  if (!$url) {

    // $path is not an alias, use $path as is for our test
    $url = $path;
  }
  $p = explode('/', $url);
  if (count($p) == 2 && $p[0] == 'node' && is_numeric($p[1])) {

    // if protected, do not cache (i.e. not caching == return FALSE)
    return !protected_node_isset_protected($p[1]);
  }
}