function autologout_nodeapi in Automated Logout 5
Same name and namespace in other branches
- 6 autologout.module \autologout_nodeapi()
- 6.2 autologout.module \autologout_nodeapi()
Implementation of hook_nodeapi()
File
- ./autologout.module, line 269 
- Used to automagically log out a user after a preset time, AjK May 2006
Code
function autologout_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
  _autologout_debug("autologout_nodeapi({$op})");
  // if a user is entering data then don't log them out or
  // they will loose their work. There's nothing more
  // frustrating than entering alot of info only for a
  // website to throw it away!
  switch ($op) {
    case "insert":
    case "update":
    case "execute":
    case "validate":
    case "prepare":
    case "delete":
      if (!(int) _autologout_local_settings('refresh_delta')) {
        $_SESSION['lastaccess'] = time();
      }
      break;
  }
}