You are here

function esi_panels_esi_context_alter in ESI: Edge Side Includes 7.3

Implements hook_esi_context_alter().

File

modules/esi_panels/esi_panels.module, line 454
ESI handler for panel panes.

Code

function esi_panels_esi_context_alter(&$contexts) {

  // Generate a pseudo-random value if none is configured.
  if (!variable_get('esi_panels_auth_cache_hash', NULL)) {
    variable_set('esi_panels_auth_cache_hash', md5('epach' . rand(0, 1000) . microtime()));
  }

  // Only called if logged in, so safe to assume user is authenticated.
  $contexts['AUTH'] = variable_get('esi_panels_auth_cache_hash', 1);
}