Domanda

I'm using the Drupal module "Autologout." https://drupal.org/project/autologout This module has a timer. When there is no activity on the page for a prescribed amount of time, it kills your session.

I would like to be able to manipulate the timer value. I looked throught the Drupal object in javascript but I can't seem to find where the value is stored. I would like to be able to set activityResetTimer to 0, for example. It seems to be declared here:

autologout.js

(function ($) {
Drupal.behaviors.autologout = {
attach: function(context, settings) {
    console.log("This is happening");

  if (context != document) {
    console.log("CONTEXT IS NOT DOCUMENTS");
    return;
  }

  var paddingTimer;
  var t;
  var theDialog;
  var localSettings;

  // Activity is a boolean used to detect a user has
  // interacted with the page.
  var activity;

  // Timer to keep track of activity resets.
  var activityResetTimer;

I have looked everywhere (seemingly) in the Drupal js object, but nowhere do I see the activityResetTimer.; http://pastebin.com/PYD2bfcP If you need me to share this in some other way, let me know, I can edit. Also let me know if you need more information or details.

Much appreciated.

È stato utile?

Soluzione

Due the nature of this module, it doesn't just store a local variable with a countdown. It uses some Ajax request, form time to time, to check if it should keep the user logged.

If you would like to rewrite the behavior of this counter or interfere on how it works, you should take a look at the module's API. Take a look at autologout.api.php file to see if it has the methods you can use.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top