HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/www2/modules/autologout/autologout.api.php
<?php

/**
 * @file
 * Describe hooks provided by the autologout module.
 */

/**
 * Prevent autologout logging a user out.
 *
 * This allows other modules to indicate that a page should not be included
 * in the autologout checks. This works in the same way as not ticking the
 * enforce on admin pages option for autologout which stops a user being logged
 * out of admin pages.
 *
 * @return bool
 *   Return TRUE if you do not want the user to be logged out.
 *   Return FALSE (or nothing) if you want to leave the autologout
 *   process alone.
 */
function hook_autologout_prevent() {
  // Don't include autologout JS checks on ajax callbacks.
  if (in_array(arg(0), array('ajax', 'autologout_ahah_logout', 'autologout_ahah_set_last'))) {
    return TRUE;
  }
}

/**
 * Keep a login alive whilst the user is on a particular page.
 *
 * @return bool
 *   By returning TRUE from this function the JS which talks to autologout
 *   module is included in the current page request and peridoically dials
 *   back to the server to keep the login alive.
 *   Return FALSE (or nothing) to just use the standard behaviour.
 */
function hook_autologout_refresh_only() {
  // Check to see if an open admin page will keep
  // login alive.
  if (arg(0) == 'admin' && !variable_get('autologout_enforce_admin', FALSE)) {
    return TRUE;
  }
}