function advagg_admin_toggle_bypass_cookie

cis7 advagg.admin.inc advagg_admin_toggle_bypass_cookie()
cle7 advagg.admin.inc advagg_admin_toggle_bypass_cookie()
elmsmedia7 advagg.admin.inc advagg_admin_toggle_bypass_cookie()
icor7 advagg.admin.inc advagg_admin_toggle_bypass_cookie()
meedjum_blog7 advagg.admin.inc advagg_admin_toggle_bypass_cookie()
mooc7 advagg.admin.inc advagg_admin_toggle_bypass_cookie()

Set or remove the AdvAggDisabled cookie.

1 string reference to 'advagg_admin_toggle_bypass_cookie'
advagg_admin_operations_form in sites/all/modules/ulmus/advagg/advagg.admin.inc
Form builder; Do advagg operations.

File

sites/all/modules/ulmus/advagg/advagg.admin.inc, line 505
Admin page callbacks for the advanced CSS/JS aggregation module.

Code

function advagg_admin_toggle_bypass_cookie() {
  $cookie_name = 'AdvAggDisabled';
  $key = drupal_hash_base64(drupal_get_private_key());

  // If the cookie does exist then remove it.
  if (!empty($_COOKIE[$cookie_name]) && $_COOKIE[$cookie_name] == $key) {
    setcookie($cookie_name, '', -1, $GLOBALS['base_path'], '.' . $_SERVER['HTTP_HOST']);
    unset($_COOKIE[$cookie_name]);
    drupal_set_message(t('AdvAgg Bypass Cookie Removed.'));
  }
  // If the cookie does not exist then set it.
  else {
    // Cookie will last for 12 hours.
    setcookie($cookie_name, $key, REQUEST_TIME + (60 * 60 * 12), $GLOBALS['base_path'], '.' . $_SERVER['HTTP_HOST']);
    $_COOKIE[$cookie_name] = $key;
    drupal_set_message(t('AdvAgg Bypass Cookie Set.'));
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.