You are here

function autologout_page_build in Automated Logout 7.4

Implements hook_page_build().

Add a form element to every page which is used to detect if the page was loaded from browser cache. This happens when the browser's back button is pressed for example. The JS will set the value of the hidden input element to 1 after initial load. If this is 1 on subsequent loads, the page was loaded from cache and an autologout timeout refresh needs to be triggered.

File

./autologout.module, line 515
Used to automagically log out a user after a preset time.

Code

function autologout_page_build(&$page) {
  if (!_autologout_prevent()) {
    $page['page_bottom']['autologout'] = array(
      '#markup' => '<form id="autologout-cache-check"><input type="hidden" id="autologout-cache-check-bit" value="0" /></form>',
    );
  }
}