Skip to content

Commit

Permalink
Ability to have password output in the password input box for forms (…
Browse files Browse the repository at this point in the history
…stops passwords from being unintentionally wiped out - but is less secure)
  • Loading branch information
DominicWatson committed Jan 29, 2015
1 parent fcdd655 commit c72b16b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/forms/system-config/email.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This form is used for configuring the mail server and other mail related setting
<field sortorder="10" name="server" control="textinput" required="false" label="system-config.email:server.label" help="system-config.email:server.help" placeholder="system-config.email:server.placeholder" />
<field sortorder="20" name="port" control="spinner" required="false" default="25" label="system-config.email:port.label" help="system-config.email:port.help" maxValue="99999" />
<field sortorder="30" name="username" control="textinput" required="false" label="system-config.email:username.label" help="system-config.email:username.help" />
<field sortorder="40" name="password" control="password" required="false" label="system-config.email:password.label" help="system-config.email:password.help" />
<field sortorder="40" name="password" control="password" required="false" label="system-config.email:password.label" help="system-config.email:password.help" outputSavedValue="true" />
<field sortorder="50" name="default_from_address" control="textinput" required="false" label="system-config.email:default_from_address.label" help="system-config.email:default_from_address.help" placeholder="system-config.email:default_from_address.placeholder" />
</fieldset>
</tab>
Expand Down
13 changes: 12 additions & 1 deletion system/views/formcontrols/password/index.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@
if ( Len( Trim( placeholder ) ) ) {
placeholder = translateResource( uri=placeholder, defaultValue=placeholder );
}
if ( IsTrue( args.outputSavedValue ?: "" ) ) {
defaultValue = args.defaultValue ?: "";
value = event.getValue( name=inputName, defaultValue=defaultValue );
if ( not IsSimpleValue( value ) ) {
value = "";
}
value = HtmlEditFormat( value );
} else {
value = "";
}
</cfscript>

<cfoutput>
<input type="password" id="#inputId#" placeholder="#placeholder#" name="#inputName#" tabindex="#getNextTabIndex()#">
<input type="password" id="#inputId#" placeholder="#placeholder#" name="#inputName#" tabindex="#getNextTabIndex()#" value="#value#">
</cfoutput>

0 comments on commit c72b16b

Please sign in to comment.