You are here

function hook_autologout_refresh_only in Automated Logout 8

Same name and namespace in other branches
  1. 6.4 autologout.api.php \hook_autologout_refresh_only()
  2. 7.4 autologout.api.php \hook_autologout_refresh_only()

Keep a login alive whilst the user is on a particular page.

Return value

bool By returning TRUE from this function the JS which talks to autologout module is included in the current page request and periodically dials back to the server to keep the login alive. Return FALSE (or nothing) to just use the standard behaviour.

1 function implements hook_autologout_refresh_only()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

autologout_autologout_refresh_only in ./autologout.module
Implements hook_autologout_refresh_only().
1 invocation of hook_autologout_refresh_only()
AutologoutManager::refreshOnly in src/AutologoutManager.php
Determine if connection should be refreshed.

File

./autologout.api.php, line 44
Describe hooks provided by the autologout module.

Code

function hook_autologout_refresh_only() {

  // Check to see if an open admin page will keep login alive.
  if (\Drupal::service('router.admin_context')
    ->isAdminRoute(routeMatch()
    ->getRouteObject()) && !\Drupal::config('autologout.settings')
    ->get('enforce_admin')) {
    return TRUE;
  }
}