• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Custom Messages?

Engaged ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

Hi,

I would like to build some custom message handler to handle various custom messages throughout the app. I am not interested in the CF errors and/or messages, but more of things like "Account Updated" "Account Locked due to multiple attempts". I am looking to have a storage mechanishm to hold these error messages either in the DB which may be easiest for me or I have heard of some using an XML File and reading from that. I want to use UUID's for each error message so in the url you might see errorId=4854-48484-24121-545464 or some long UUID. I think this will prevent or deter url tampering, having simple values like errorCode=3 or errorCode=4 seems to easy for users to swap values. At least it seems that way to me.

As of now, I do this on the display page

<cfparam name="variables.errorMsg" default="" />
<cfparam name="attributes.ec" default="0" />

<cfswitch expression="#attributes.ec#">
<cfcase value="1">
<cfset variables.errorMsg = "Account not found. Please try again. " />
</cfcase>
<cfcase value="2">
<cfset variables.errorMsg = "Account Locked. "/>
</cfcase>
</cfswitch>

This does work, but Id like to find a more elegant solution.

Any thoughts?

-Westside
TOPICS
Advanced techniques

Views

171

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

You could use toBase64() to encode the strings in a URL-safe format that is hard to tamper with (at least for the general population). Is there a particular reason you are worried about the users playing around with what error messages they see?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 15, 2007 Mar 15, 2007

Copy link to clipboard

Copied

LATEST
Hi,

Well, I was planning to use some of a UUID or use sql server's newId() function in other areas of the system, so certain parts of the app would pass these uuid's in the url and I wanted to be consistent all the way around. That is part of it. Small part of it is me just not wanting the user to do it also. But it was more for consistency.

-Westside

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation