From 673032e6854dc61e0ea29338fa1f91128ac3b77c Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 25 May 2001 14:13:52 +0000 Subject: [PATCH] introduced currentUser as handler for the current user object, regardless of request path etc. accessing a property that is null in the skin parameter object will produce "" instead of "null" --- src/helma/framework/core/Skin.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/helma/framework/core/Skin.java b/src/helma/framework/core/Skin.java index ca120775..bfe34a37 100644 --- a/src/helma/framework/core/Skin.java +++ b/src/helma/framework/core/Skin.java @@ -197,8 +197,11 @@ public class Skin { arguments[0] = par; if (handler != null) { - // not a global macro - need to find handler object - if (thisNode != null) { + if ("currentuser".equalsIgnoreCase (handler)) { + // as a special convention, we use "currentuser" to access macros in the current user object + handlerObject = reval.getNodeWrapper (reval.user.getNode ()); + } else if (thisNode != null) { + // not a global macro - need to find handler object // was called with this object - check it or its parents for matching prototype if (!handler.equalsIgnoreCase ("this") && !handler.equalsIgnoreCase (thisNode.getPrototypeName ())) { // the handler object is not what we want @@ -273,7 +276,7 @@ public class Skin { else { try { ESValue value = paramObject.getProperty (name, name.hashCode()); - if (value != null && value != ESUndefined.theUndefined) + if (value != null && value != ESUndefined.theUndefined && value != ESNull.theNull) reval.res.write (value); } catch (EcmaScriptException ignore) {} }