Skip to content

Commit

Permalink
disable debugging for Lucee admin
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 9, 2024
1 parent ad1f961 commit ac0781d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/cfml/context/admin/Application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function onRequestStart() {
var fileName=listLast(cgi.script_name,"/");
if(fileName!="admin.cfm" && fileName!="web.cfm" && fileName!="server.cfm" && fileName!="index.cfm" && fileName!="restart.cfm") {
writeLog(text="Lucee Admin request to restricted file [#filename#] before login", type="error", log="application");
cfsetting(showdebugoutput:false);
cfsetting(show:false);
cfheader(statuscode="404" statustext="Invalid access");
cfcontent(reset="true");
abort;
Expand Down
8 changes: 5 additions & 3 deletions core/src/main/cfml/context/admin/web.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
}
param name="request.disableFrame" default="false" type="boolean";
param name="request.setCFApplication" default="true" type="boolean";
if(request.setCFApplication) {
application name="webadmin#server.lucee.version#"
application action="update"
sessionmanagement="yes"
clientmanagement="no"
setclientcookies="yes"
Expand All @@ -24,8 +23,11 @@
sessiontimeout="#createTimeSpan(0,0,30,0)#"
applicationtimeout="#createTimeSpan(1,0,0,0)#"
localmode="update"
webcharset="utf-8";
webcharset="utf-8"
show="#false#";
cfsetting(show:false);
}
</cfscript><cfsilent>

<!--- todo: remember screenwidth, so images have the correct width etc. --->
Expand Down
13 changes: 13 additions & 0 deletions core/src/main/java/lucee/runtime/tag/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public final class Application extends TagImpl implements DynamicAttributes {
private Boolean showDebug;
private Boolean showMetric;
private Boolean showTest;
private Boolean show;

private Boolean debuggingDatabase;
private Boolean debuggingException;
Expand Down Expand Up @@ -270,6 +271,7 @@ public void release() {
showDoc = null;
showMetric = null;
showTest = null;
show = null;

this.debuggingDatabase = null;
this.debuggingException = null;
Expand Down Expand Up @@ -735,6 +737,10 @@ public void setShowtest(boolean showTest) {
this.showTest = showTest;
}

public void setShow(boolean show) {
this.show = show;
}

public void setRegex(Object data) throws PageException {
if (Decision.isSimpleValue(data)) {
regex = RegexFactory.toRegex(RegexFactory.toType(Caster.toString(data)), null);
Expand Down Expand Up @@ -986,6 +992,13 @@ else if ((sct = Caster.toStruct(e.getValue(), null)) != null) {
if (searchQueries != null) appContextSup.setAllowImplicidQueryCall(searchQueries.booleanValue());
if (regex != null) appContextSup.setRegex(regex);

if (show != null) {
appContextSup.setShowDebug(show.booleanValue());
appContextSup.setShowDoc(show.booleanValue());
appContextSup.setShowMetric(show.booleanValue());
appContextSup.setShowTest(show.booleanValue());
}
// overrule previous with specific
if (showDebug != null) appContextSup.setShowDebug(showDebug.booleanValue());
if (showDoc != null) appContextSup.setShowDoc(showDoc.booleanValue());
if (showMetric != null) appContextSup.setShowMetric(showMetric.booleanValue());
Expand Down
9 changes: 9 additions & 0 deletions core/src/main/java/resource/tld/core-base.tld
Original file line number Diff line number Diff line change
Expand Up @@ -5722,6 +5722,15 @@ This attribute only takes effect when a custom debug template is defined in the
otherwise display at the end of the generated page.</description>
<introduced>6.1.0.155</introduced>
</attribute>
<attribute>
<type>boolean</type>
<name>show</name>
<required>false</required>
<status>hidden</status>
<rtexprvalue>true</rtexprvalue>
<description></description>
<introduced>6.1.1.81</introduced>
</attribute>
<attribute>
<type>number</type>
<name>requestTimeOut</name>
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.1.1.80-SNAPSHOT"/>
<property name="version" value="6.1.1.81-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
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.1.1.80-SNAPSHOT</version>
<version>6.1.1.81-SNAPSHOT</version>
<packaging>jar</packaging>

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

0 comments on commit ac0781d

Please sign in to comment.