You are here

function authcache_debug_admin_submit in Authenticated User Page Caching (Authcache) 7.2

Authcache config form submit.

File

modules/authcache_debug/authcache_debug.admin.inc, line 75
Admin forms and pages.

Code

function authcache_debug_admin_submit($form, &$form_state) {
  $debug_user_ray = array();

  // Debugging for users.
  $debug_users = explode(',', $form_state['values']['debug_users']);
  foreach ($debug_users as $username) {
    $debug_user_ray[] = trim($username);
  }
  $form_state['values']['debug_users'] = $debug_user_ray;

  // Delete variable if not in use.
  $varnames = array(
    'debug_all',
    'debug_page',
    'debug_users',
    'debug_cache_lifetime',
    'debug_watchdog',
  );
  foreach ($varnames as $key) {
    if ($value = $form_state['values'][$key]) {
      variable_set("authcache_{$key}", $value);
    }
    else {
      variable_del("authcache_{$key}");
    }
  }
  drupal_set_message(t('Your settings have been saved.'));
}