Skip to content

Commit

Permalink
LDEV-4956 setAdminPassword and adminPassword
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jul 1, 2024
1 parent cba5040 commit 6ef30ad
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 39 deletions.
87 changes: 48 additions & 39 deletions build-run-cfml.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="all" basedir="." name="run-cfml">
<macrodef name="echots">
<attribute name="message"/>
<attribute name="message" />
<sequential>
<local name="timestamp" />
<tstamp>
Expand All @@ -11,43 +11,46 @@
</sequential>
</macrodef>
<target name="all">
<echots message="Lucee Starting"/>
<echots message="Lucee Starting" />
<script language="CFML">
<![CDATA[
systemOutput( "---------- #DateTimeFormat(now(),'yyyy-mm-dd HH:nn:ss')# - Lucee Started ----------", true);
systemOutput( "#server.lucee.version#", true );
request.adminPassword="admin";
param name="adminPassword" default="admin";
request.adminPassword = adminPassword;
request.errorThrown = false;
try {
param name="setAdminPassword" default="true";
if ( setAdminPassword ) {
// set a password for the admin
try {
admin
action="updatePassword"
type="web"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Web admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
}
// set a password for the admin
try {
admin
action="updatePassword"
type="web"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Web admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
}
try {
admin
action="updatePassword"
type="server"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Server admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
try {
admin
action="updatePassword"
type="server"
oldPassword=""
newPassword="#request.adminPassword#";
systemOutput( "Set Server admin password", true );
}
catch(e){
systemOutput( e.message, true ); // may exist from previous execution
}
}
admin
action="updateMapping"
type="web"
Expand All @@ -59,18 +62,24 @@
primary="physical"
trusted="no";
admin
action="getMappings"
type="web"
password="#request.adminPassword#"
returnVariable="mappings";
systemOutput( "-------------- Mappings --------------", true );
loop query="mappings" {
systemOutput("#mappings.virtual# #chr( 9 )# #mappings.strPhysical# "
& ( len( mappings.strArchive ) ? "[#mappings.strArchive#] " : "" )
& ( len( mappings.inspect ) ? "(#mappings.inspect#)" : ""), true );
try {
admin
action="getMappings"
type="web"
password="#request.adminPassword#"
returnVariable="mappings";
loop query="mappings" {
systemOutput("#mappings.virtual# #chr( 9 )# #mappings.strPhysical# "
& ( len( mappings.strArchive ) ? "[#mappings.strArchive#] " : "" )
& ( len( mappings.inspect ) ? "(#mappings.inspect#)" : ""), true );
}
} catch( e ){
systemOutput( e.message, true );
}
systemOutput( "ExpandPath( '/' ) #chr(9)# #ExpandPath( '/' )#" , true );
param name="extensionDir" default="";
if ( len( extensionDir) ){
Expand Down Expand Up @@ -195,6 +204,6 @@
}
]]>
</script>
<echots message="Lucee Stopping"/>
<echots message="Lucee Stopping" />
</target>
</project>
</project>
7 changes: 7 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<property name="preCleanup" value="true"/>
<!-- delete the Lucee working dir afterwards -->
<property name="postCleanup" value="true"/>
<property name="setAdminPassword" value="true"/>
<property name="adminPassword" value="admin"/>

<!-- scripts can be run as an include, or via internalRequest (default) which picks up any Application.cfc -->
<property name="executeScriptByInclude" value=""/>
Expand Down Expand Up @@ -89,6 +91,8 @@
<echo message="executeScriptByInclude: ${executeScriptByInclude}" />
<echo message="luceeCFconfig: ${luceeCFconfig}" />
<echo message="javaDebugger: ${debugger}" />
<echo message="setAdminPassword: ${setAdminPassword}" />
<echo message="adminPassword: ${adminPassword}" />

<echo message="" />
<!-- execute CFML testcases -->
Expand Down Expand Up @@ -121,6 +125,9 @@
<jvmarg value="-Dlucee.extensions=${extensions}"/>
<jvmarg value="-Dlucee.mapping.first=true"/>
<jvmarg value="-Dcompile=${compile}"/>
<jvmarg value="-DsetAdminPassword=${setAdminPassword}"/>
<jvmarg value="-DadminPassword=${adminPassword}"/>

<!--
<jvmarg value="-Dlucee.cli.printExceptions=true"/>
-->
Expand Down

0 comments on commit 6ef30ad

Please sign in to comment.