I use the Automated Logout module in combination with the jQuery UI filter module and some other modules. After enabling the Automated Logout module the jQuery UI filter stops working.

I find the main problem it is in the autologout_init function(). There will be the system ui.dialog included. This breaks the module, because of a missing true. After adding the true to
drupal_add_library('system', 'ui.dialog', TRUE); it works as expected.

Addionally I should say that I also use the ADVANCED CSS/JS AGGREGATION. Maybe the incompatibility is caused by the aggregation.

This is the working autologout_init function()

function autologout_init() {
  global $user;

  if (empty($user->uid)) {
    if (!empty($_GET['autologout_timeout']) && $_GET['autologout_timeout'] == 1 && empty($_POST)) {
      _autologout_inactivity_message();
    }
    return;
  }

  // Check if JS should be included on this request.
  if (_autologout_prevent()) {
    return;
  }

  // Check if anything wants to be refresh only. This URL would
  // include the javascript but will keep the login alive whilst
  // that page is opened.
  $refresh_only = _autologout_refresh_only();

  $now = time();
  $timeout = _autologout_get_user_timeout();
  $timeout_padding = variable_get('autologout_padding', 10);
  $redirect_url = variable_get('autologout_redirect_url', 'user/login');
  $redirect_query = drupal_get_destination() + array('autologout_timeout' => 1);
  $no_dialog = variable_get('autologout_no_dialog', FALSE);
  drupal_add_library('system', 'ui.dialog', TRUE); // HERE IS THE TRUE 

  // Get all settings JS will need for dialog.
  $msg = t(variable_get('autologout_message', 'Your session is about to expire. Do you want to reset it?'));
  $settings = array(
    'timeout' => $refresh_only ? ($timeout * 500) : ($timeout * 1000),
    'timeout_padding' => $timeout_padding * 1000,
    'message' => $msg,
    'redirect_url' => url($redirect_url, array('query' => $redirect_query)),
    'title' => t('@name Alert', array('@name' => variable_get('site_name', 'Drupal'))),
    'refresh_only' => $refresh_only,
    'no_dialog' => $no_dialog,
  );

  // If this is an AJAX request, then the logout redirect url should still be
  // referring to the page that generated this request
  if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    global $base_url;
    $relative_url = str_replace($base_url . '/', '', $_SERVER['HTTP_REFERER']);
    $settings['redirect_url'] = url($redirect_url, array('query' => array('destination' => urlencode($relative_url)), 'autologout_timeout' => 1));
  }

  drupal_add_library('system', 'drupal.ajax');
  drupal_add_js(array('autologout' => $settings), 'setting');
  drupal_add_js(drupal_get_path('module', 'autologout') . "/autologout.js");

  // We need a backup plan if JS is disabled.
  if (!$refresh_only && isset($_SESSION['autologout_last'])) {
    // If time since last access is > than the timeout + padding, log them out.
    if (($now - $_SESSION['autologout_last']) >= ($timeout + (int) $timeout_padding)) {
      _autologout_logout();

      // User has changed so force Drupal to remake decisions based on user.
      global $theme, $theme_key;
      drupal_static_reset();
      $theme = NULL;
      $theme_key = NULL;
      menu_set_custom_theme();
      drupal_theme_initialize();
      _autologout_inactivity_message();
    }
    else {
      $_SESSION['autologout_last'] = $now;
    }
  }
  else {
    $_SESSION['autologout_last'] = $now;
  }
}

Comments

DeaOm’s picture

Version: 7.x-4.3 » 7.x-4.x-dev
Assigned: » Unassigned
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Hi @Almare. Is this still happening? Some steps to reproduce it would be great. I think here the problem was in the aggregation, since there is no other report of the issue.