function authcache_init in Authenticated User Page Caching (Authcache) 7.2
Same name and namespace in other branches
- 6 authcache.module \authcache_init()
- 7 authcache.module \authcache_init()
Implements hook_init().
File
- ./
authcache.module, line 92 - Authenticated User Page Caching (and anonymous users, too!)
Code
function authcache_init() {
global $conf, $user;
$reasons = module_invoke_all('authcache_request_exclude');
if (!empty($reasons)) {
_authcache_exclude(reset($reasons));
}
$reasons = module_invoke_all('authcache_account_exclude', $user);
if (!empty($reasons)) {
_authcache_exclude(reset($reasons));
}
if (!authcache_excluded()) {
// Don't allow format_date() to use the user's local timezone.
$conf['configurable_timezones'] = FALSE;
}
// Attach required JavaScript.
drupal_add_library('system', 'jquery.cookie');
drupal_add_js(drupal_get_path('module', 'authcache') . '/authcache.js');
// Inject authcache cookie settings.
drupal_add_js(array(
'authcache' => array(
'q' => $_GET['q'],
'cp' => array(
'path' => ini_get('session.cookie_path'),
'domain' => ini_get('session.cookie_domain'),
'secure' => ini_get('session.cookie_secure') == '1',
),
'cl' => max(1, (int) authcache_key_lifetime() / 86400),
),
), 'setting');
if (!authcache_excluded()) {
// Remember original output buffering level.
_authcache_original_ob_level(TRUE);
}
}