Hi,

My site has video upload and some files are big and take too much time to upload.

How can i avoid the logout for a user at an admin page AND uploading?

thanks

Comments

svnindia’s picture

Any Solutions found for this...

svnindia’s picture

In the custom module hook_init() by updating $_SESSION['lastaccess'] = time(); based on some condition can solve our issue...

johnennew’s picture

Status: Active » Needs review

The 7.x-4.x and 6.x-4.x branches now provide two hooks other's can use for preventing logout.

read the autologout.api.php file in the latest development branches for exact details but simply hook_autologout_prevent() can be used to not include the autologout js from being included (useful for ajax callbacks) and hook_autologout_refresh_only includes the JS which will keep the session active whist the user is on that page.

To implement in your own module you might use:

/**
 * Implements hook_autologout_refresh_only().
 *
 * Do not autologout when editing nodes of type large_file.
 * (large_file is the name of a content type).
 */
function mymodule_autologout_refresh_only() {
  if (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'large-file') {
    return TRUE;
  }
  elseif (arg(0) == 'node' && arg(2) == 'edit') {
    $node = node_load(arg(1));
    if (is_object($node) && $node->type == 'large_file') {
      return TRUE;
    }
  }
}
johnennew’s picture

Status: Needs review » Fixed

setting to fixed - reopen if you'd like to discuss further.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.