From 5e34cfdcc794d2e0b717c34ba645d856a66fde4e Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 11 Jun 2002 15:54:10 +0000 Subject: [PATCH] user.onLogout() is called again, at least for automatic session timeouts. --- src/helma/framework/core/Application.java | 10 ++++++---- src/helma/framework/core/RequestEvaluator.java | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index b01b0804..3ebd0f64 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -27,7 +27,9 @@ import java.rmi.server.*; * requests from the Web server or XML-RPC port and dispatches them to * the evaluators. */ -public final class Application extends UnicastRemoteObject implements IRemoteApp, IPathElement, IReplicatedApp, Runnable { +public final class Application + extends UnicastRemoteObject + implements IRemoteApp, IPathElement, IReplicatedApp, Runnable { private String name; SystemProperties props, dbProps; @@ -1091,10 +1093,10 @@ public final class Application extends UnicastRemoteObject implements IRemoteApp for (Enumeration e = cloned.elements (); e.hasMoreElements (); ) { Session session = (Session) e.nextElement (); if (now - session.lastTouched () > sessionTimeout * 60000) { - INode usernode = session.getUserNode (); - if (usernode != null) { + NodeHandle userhandle = session.userHandle; + if (userhandle != null) { try { - eval.invokeFunction (usernode, "onLogout", new Object[0]); + eval.invokeFunction (userhandle, "onLogout", new Object[0]); } catch (Exception ignore) {} } destroySession(session); diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index 595e4ab8..13a3c321 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -367,6 +367,16 @@ public final class RequestEvaluator implements Runnable { // Just a human readable descriptor of this invocation String funcdesc = app.getName()+":internal/"+method; + // if thisObject is an instance of NodeHandle, get the node object itself. + if (thisObject != null && thisObject instanceof NodeHandle) { + thisObject = ((NodeHandle) thisObject).getNode (app.nmgr.safe); + // see if a valid node was returned + if (thisObject == null) { + reqtype = NONE; + break; + } + } + // avoid going into transaction if called function doesn't exist boolean functionexists = true; functionexists = scriptingEngine.hasFunction (thisObject, method);