Skip to content

Commit

Permalink
Merge branch '6.0' of https://github.com/lucee/Lucee into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Apr 12, 2021
2 parents 4e8455b + e1fabd9 commit fc3a6fb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
4 changes: 2 additions & 2 deletions core/src/main/cfml/context/admin/resources/menu.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
struct(action:"error",label:arguments.stMenu.server.error),
struct(action:"logging",label:arguments.stMenu.server.logging),
struct(action:"regex",label:(arguments.stMenu.server.regex?:"Regex")),
struct(action:"export",label:arguments.stMenu.server.export),
struct(action:"proxy",label:arguments.stMenu.server.proxy)
struct(action:"export",label:arguments.stMenu.server.export)
//,struct(action:"proxy",label:arguments.stMenu.server.proxy)
)
),
struct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ public static Object call(PageContext pc, String hql, Object paramsOrUnique, Obj
return _call(pc, hql, paramsOrUnique, false, Caster.toStruct(uniqueOrQueryOptions));
}

public static Object call(PageContext pc, String hql, Object params, Object unique, Object queryOptions) throws PageException {
return _call(pc, hql, params, Caster.toBooleanValue(unique), Caster.toStruct(queryOptions));
public static Object call(PageContext pc, String hql, Object params, Object oUnique, Object oQueryOptions) throws PageException {
boolean unique;
if (StringUtil.isEmpty(oUnique)) unique = false;
else unique = Caster.toBooleanValue(oUnique);

Struct queryOptions;
if (oQueryOptions == null) queryOptions = null;
else queryOptions = Caster.toStruct(oQueryOptions);

return _call(pc, hql, params, unique, queryOptions);
}

private static Object _call(PageContext pc, String hql, Object params, boolean unique, Struct queryOptions) throws PageException {
Expand Down
32 changes: 17 additions & 15 deletions core/src/main/java/lucee/runtime/type/scope/ScopeContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public final class ScopeContext {
private StorageScopeEngine client;
private StorageScopeEngine session;
private CFMLFactoryImpl factory;
private Log log;

public ScopeContext(CFMLFactoryImpl factory) {
this.factory = factory;
Expand All @@ -114,11 +113,7 @@ public ScopeContext(CFMLFactoryImpl factory) {
* @return the log
*/
private Log getLog() {
if (log == null) {
this.log = factory.getConfig().getLog("scope");

}
return log;
return factory.getConfig().getLog("scope");
}

public void debug(String msg) {
Expand Down Expand Up @@ -485,7 +480,7 @@ private boolean hasExistingJSessionScope(PageContext pc) {
if (httpSession == null) return false;

Session session = (Session) httpSession.getAttribute(pc.getApplicationContext().getName());
return session instanceof JSession;
return session instanceof JSession && !session.isExpired();
}

private boolean hasExistingCFSessionScope(PageContext pc, String cfid) {
Expand Down Expand Up @@ -725,7 +720,9 @@ private Session getJSessionScope(PageContext pc, RefBoolean isNew) throws PageEx
jSession = (JSession) session;
try {
if (jSession.isExpired()) {
jSession.touch();
if (httpSession == null) jSession.touch();
else jSession = createNewJSession(pc, httpSession, isNew);

}
info(getLog(), "use existing JSession for " + appContext.getName() + "/" + pc.getCFID());

Expand All @@ -743,18 +740,23 @@ private Session getJSessionScope(PageContext pc, RefBoolean isNew) throws PageEx
else {
// if there is no HTTPSession
if (httpSession == null) return getCFSessionScope(pc, isNew);

info(getLog(), "create new JSession for " + appContext.getName() + "/" + pc.getCFID());
jSession = new JSession();
httpSession.setAttribute(appContext.getName(), jSession);
isNew.setValue(true);
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
context.put(pc.getCFID(), jSession);
jSession = createNewJSession(pc, httpSession, isNew);
}
jSession.touchBeforeRequest(pc);
return jSession;
}

private JSession createNewJSession(PageContext pc, HttpSession httpSession, RefBoolean isNew) {
ApplicationContext appContext = pc.getApplicationContext();
debug(getLog(), "create new JSession for " + appContext.getName() + "/" + pc.getCFID());
JSession jSession = new JSession();
httpSession.setAttribute(appContext.getName(), jSession);
isNew.setValue(true);
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
context.put(pc.getCFID(), jSession);
return jSession;
}

/**
* return the application Scope for this context (cfid,cftoken,contextname)
*
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="core" basedir="." name="Lucee" xmlns:artifact="antlib:org.apache.maven.artifact.ant">

<property name="version" value="6.0.0.86-SNAPSHOT"/>
<property name="version" value="6.0.0.87-SNAPSHOT"/>

<path id="maven-ant-tasks.classpath" path="../ant/lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.0.0.86-SNAPSHOT</version>
<version>6.0.0.87-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit fc3a6fb

Please sign in to comment.